mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-02 09:06:02 -04:00
switch IRC-style command parser to use regexps rather than split(" ") so that it doesn't choke on consecutive whitespaces
yield better errors for invalid commands don't pass invalid commands through as messages support kick reasons
This commit is contained in:
parent
9c82276760
commit
3bc7bba262
2 changed files with 96 additions and 55 deletions
|
@ -169,14 +169,19 @@ angular.module('matrixService', [])
|
|||
|
||||
// Change the membership of an another user
|
||||
setMembership: function(room_id, user_id, membershipValue) {
|
||||
return this.setMemberShipObject(room_id, user_id, {
|
||||
membership : membershipValue
|
||||
});
|
||||
},
|
||||
|
||||
// Change the membership of an another user
|
||||
setMembershipObject: function(room_id, user_id, membershipObject) {
|
||||
// The REST path spec
|
||||
var path = "/rooms/$room_id/state/m.room.member/$user_id";
|
||||
path = path.replace("$room_id", encodeURIComponent(room_id));
|
||||
path = path.replace("$user_id", user_id);
|
||||
|
||||
return doRequest("PUT", path, undefined, {
|
||||
membership: membershipValue
|
||||
});
|
||||
return doRequest("PUT", path, undefined, membershipObject);
|
||||
},
|
||||
|
||||
// Bans a user from from a room
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue