summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-11-20 18:07:26 +0000
committerMark Haines <mjark@negativecurvature.net>2015-11-20 18:07:26 +0000
commitc6a15f5026035b2bdd62cffaf0e2d70497197d05 (patch)
treec57fcad9c735e2146cd080f47c1d43252607f4b8 /synapse/api/auth.py
parentMerge pull request #395 from matrix-org/erikj/perspective_limiter (diff)
parentMerge branch 'daniel/forgetrooms' of github.com:matrix-org/synapse into danie... (diff)
downloadsynapse-c6a15f5026035b2bdd62cffaf0e2d70497197d05.tar.xz
Merge pull request #385 from matrix-org/daniel/forgetrooms
Allow users to forget rooms
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 4a13f7e2e1..4fdc779b4b 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -207,6 +207,13 @@ class Auth(object):
                 user_id, room_id
             ))
 
+        if membership == Membership.LEAVE:
+            forgot = yield self.store.did_forget(user_id, room_id)
+            if forgot:
+                raise AuthError(403, "User %s not in room %s" % (
+                    user_id, room_id
+                ))
+
         defer.returnValue(member)
 
     @defer.inlineCallbacks