1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Add getStateEvent API (used by IRC AS to get display names for people)

This commit is contained in:
Kegan Dougal
2015-05-12 14:24:05 +01:00
parent 5137ac211e
commit 02b29c157f

View File

@@ -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,
callback) {
var pathParams = {