mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-01-13 10:19:26 -05:00
webclient: Updated to use /rooms/$roomid/[invite|join|leave]
This commit is contained in:
parent
5c0be8fde3
commit
9ff9caeb74
@ -115,7 +115,7 @@ angular.module('matrixService', [])
|
|||||||
|
|
||||||
// Joins a room
|
// Joins a room
|
||||||
join: function(room_id) {
|
join: function(room_id) {
|
||||||
return this.membershipChange(room_id, config.user_id, "join");
|
return this.membershipChange(room_id, undefined, "join");
|
||||||
},
|
},
|
||||||
|
|
||||||
joinAlias: function(room_alias) {
|
joinAlias: function(room_alias) {
|
||||||
@ -134,18 +134,22 @@ angular.module('matrixService', [])
|
|||||||
|
|
||||||
// Leaves a room
|
// Leaves a room
|
||||||
leave: function(room_id) {
|
leave: function(room_id) {
|
||||||
return this.membershipChange(room_id, config.user_id, "leave");
|
return this.membershipChange(room_id, undefined, "leave");
|
||||||
},
|
},
|
||||||
|
|
||||||
membershipChange: function(room_id, user_id, membershipValue) {
|
membershipChange: function(room_id, user_id, membershipValue) {
|
||||||
// The REST path spec
|
// The REST path spec
|
||||||
var path = "/rooms/$room_id/state/m.room.member/$user_id";
|
var path = "/rooms/$room_id/$membership";
|
||||||
path = path.replace("$room_id", encodeURIComponent(room_id));
|
path = path.replace("$room_id", encodeURIComponent(room_id));
|
||||||
path = path.replace("$user_id", encodeURIComponent(user_id));
|
path = path.replace("$membership", encodeURIComponent(membershipValue));
|
||||||
|
|
||||||
return doRequest("PUT", path, undefined, {
|
var data = {};
|
||||||
membership: membershipValue
|
if (user_id !== undefined) {
|
||||||
});
|
data = { user_id: user_id };
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Use PUT with transaction IDs
|
||||||
|
return doRequest("POST", path, undefined, data);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Retrieves the room ID corresponding to a room alias
|
// Retrieves the room ID corresponding to a room alias
|
||||||
|
Loading…
Reference in New Issue
Block a user