You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +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 {string} roomId
|
||||||
* @param {module:client.callback} callback Optional.
|
* @param {module:client.callback} callback Optional.
|
||||||
|
|||||||
@@ -3965,6 +3965,12 @@ MatrixClient.prototype.getCanResetTimelineCallback = function() {
|
|||||||
return this._canResetTimelineCallback;
|
return this._canResetTimelineCallback;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MatrixClient.prototype.relations =
|
||||||
|
async function(roomId, eventId, relationType, eventType) {
|
||||||
|
const events = await this.fetchRelations(roomId, eventId, relationType, eventType);
|
||||||
|
return events.map(this.getEventMapper());
|
||||||
|
};
|
||||||
|
|
||||||
function setupCallEventHandler(client) {
|
function setupCallEventHandler(client) {
|
||||||
const candidatesByCall = {
|
const candidatesByCall = {
|
||||||
// callId: [Candidate]
|
// callId: [Candidate]
|
||||||
|
|||||||
Reference in New Issue
Block a user