summary refs log tree commit diff
path: root/cmdclient/console.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmdclient/console.py')
-rwxr-xr-xcmdclient/console.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmdclient/console.py b/cmdclient/console.py
index 64557a4c40..3c4c69c276 100755
--- a/cmdclient/console.py
+++ b/cmdclient/console.py
@@ -402,9 +402,7 @@ class SynapseCmd(cmd.Cmd):
         """Leaves a room: "leave <roomid>" """
         try:
             args = self._parse(line, ["roomid"], force_keys=True)
-            path = ("/rooms/%s/members/%s/state" %
-                    (urllib.quote(args["roomid"]), self._usr()))
-            reactor.callFromThread(self._run_and_pprint, "DELETE", path)
+            self._do_membership_change(urllib.quote(args["roomid"]), "leave", self._usr())
         except Exception as e:
             print e
 
@@ -567,7 +565,7 @@ class SynapseCmd(cmd.Cmd):
                                alt_text="Sent receipt for %s" % event["msg_id"])
 
     def _do_membership_change(self, roomid, membership, userid):
-        path = "/rooms/%s/members/%s/state" % (urllib.quote(roomid), userid)
+        path = "/rooms/%s/state/m.room.member/%s" % (urllib.quote(roomid), urllib.quote(userid))
         data = {
             "membership": membership
         }