diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-12-11 18:27:01 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-12-11 18:27:01 +0000 |
commit | f25764943c81c145a8e787444c3b16c973e2286c (patch) | |
tree | 5aeecdbcfd0cfeceeb5b3d01c1d0c1f4e4601ee3 /synapse/handlers | |
parent | Actually auth-check to ensure people can only send typing notifications for r... (diff) | |
download | synapse-f25764943c81c145a8e787444c3b16c973e2286c.tar.xz |
Add a 'user_left_room' distributor signal analogous to 'user_joined_room'
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/room.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index a000b44036..c802e8f69d 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -260,6 +260,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): @@ -387,6 +388,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 |