You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
Add getStateEvent API (used by IRC AS to get display names for people)
This commit is contained in:
@@ -100,6 +100,21 @@ var init = function(exports){
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getStateEvent: function(roomId, eventType, stateKey) {
|
||||||
|
var pathParams = {
|
||||||
|
$roomId: roomId,
|
||||||
|
$eventType: eventType,
|
||||||
|
$stateKey: stateKey
|
||||||
|
};
|
||||||
|
var path = encodeUri("/rooms/$roomId/state/$eventType", pathParams);
|
||||||
|
if (stateKey !== undefined) {
|
||||||
|
path = encodeUri(path + "/$stateKey", pathParams);
|
||||||
|
}
|
||||||
|
return this._doAuthedRequest(
|
||||||
|
callback, "GET", path, undefined, content
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
sendStateEvent: function(roomId, eventType, content, stateKey,
|
sendStateEvent: function(roomId, eventType, content, stateKey,
|
||||||
callback) {
|
callback) {
|
||||||
var pathParams = {
|
var pathParams = {
|
||||||
|
|||||||
Reference in New Issue
Block a user