summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-12-15 14:45:59 +0000
committerErik Johnston <erik@matrix.org>2014-12-15 14:45:59 +0000
commit57e0e619f3ddc68673a0d7b345203b1a52ff1fa1 (patch)
treed7c45715bc9313f7602243b1cd614d95d1a24858 /synapse/handlers/room.py
parentAdd beginnings of upgrade script (diff)
parentStill send typing notifications to myself if I'm the only one in the room (it... (diff)
downloadsynapse-57e0e619f3ddc68673a0d7b345203b1a52ff1fa1.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into events_refactor
Conflicts:
	tests/handlers/test_room.py
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index e771cf317b..a1d542854d 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -244,6 +244,7 @@ class RoomMemberHandler(BaseHandler):
 
         self.distributor = hs.get_distributor()
         self.distributor.declare("user_joined_room")
+        self.distributor.declare("user_left_room")
 
     @defer.inlineCallbacks
     def get_room_members(self, room_id, membership=Membership.JOIN):
@@ -370,6 +371,12 @@ class RoomMemberHandler(BaseHandler):
                 do_auth=do_auth,
             )
 
+            if prev_state and prev_state.membership == Membership.JOIN:
+                user = self.hs.parse_userid(event.user_id)
+                self.distributor.fire(
+                    "user_left_room", user=user, room_id=event.room_id
+                )
+
         defer.returnValue({"room_id": room_id})
 
     @defer.inlineCallbacks