You've already forked matrix-js-sdk
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user