Skip to content

Commit

Permalink
Update _unstable_getSharedRooms to match spec
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed Aug 18, 2020
1 parent 80fe66c commit a919c79
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -4849,19 +4849,18 @@ MatrixClient.prototype._storeClientOptions = function() {
* @return {Promise<string[]>} Resolves to a set of rooms
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype._unstable_getSharedRooms = async function(userId) {
MatrixClient.prototype._unstable_getSharedRooms = async function() {
if (!(await this.doesServerSupportUnstableFeature("uk.half-shot.msc2666"))) {
throw Error('Server does not support shared_rooms API');
}
const path = utils.encodeUri("/uk.half-shot.msc2666/user/$userId/shared_rooms/$otherUserId", {
const path = utils.encodeUri("/uk.half-shot.msc2666/user/shared_rooms/userId", {
$userId: this.credentials.userId,
$otherUserId: userId,
});
const res = await this._http.authedRequest(
undefined, "GET", path, undefined, undefined,
{prefix: PREFIX_UNSTABLE},
);
return res.rooms;
return res.joined;
};

/**
Expand Down

0 comments on commit a919c79

Please sign in to comment.