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

basic support for /relations endpoint

This commit is contained in:
Bruno Windels
2019-05-29 18:01:40 +02:00
parent ecca8bc86e
commit 424b6303ef
2 changed files with 17 additions and 0 deletions

View File

@@ -439,6 +439,17 @@ MatrixBaseApis.prototype.createRoom = function(options, callback) {
);
};
MatrixBaseApis.prototype.fetchRelations =
async function(roomId, eventId, relationType, eventType) {
// valid options include: room_alias_name, visibility, invite
const response = await this._http.authedRequestWithPrefix(
undefined,
"GET", `/rooms/${roomId}/relations/${eventId}/${relationType}/${eventType}`,
null, null, httpApi.PREFIX_UNSTABLE,
);
return response.chunk;
};
/**
* @param {string} roomId
* @param {module:client.callback} callback Optional.