summary refs log tree commit diff
path: root/webclient/components
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2014-09-04 09:40:15 -0700
committerMatthew Hodgson <matthew@matrix.org>2014-09-04 23:14:52 -0700
commit3bc7bba2625e291fcbf0c30f30c20fc2d1756a49 (patch)
treeda2c78aa86f20b3c2b2238d9d0b18364d60bac06 /webclient/components
parentAdd version 0 of the VoIP specification. (diff)
downloadsynapse-3bc7bba2625e291fcbf0c30f30c20fc2d1756a49.tar.xz
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
Diffstat (limited to 'webclient/components')
-rw-r--r--webclient/components/matrix/matrix-service.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js
index 25222a9e9e..436ff5462a 100644
--- a/webclient/components/matrix/matrix-service.js
+++ b/webclient/components/matrix/matrix-service.js
@@ -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