0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-24 20:14:31 +01:00

Only fire user_joined_room on the distributor if the user has actually joined the room

This commit is contained in:
Mark Haines 2015-12-01 16:03:08 +00:00
parent f593a6e5f8
commit 3d3da2b460

View file

@ -517,6 +517,8 @@ class RoomMemberHandler(BaseHandler):
do_auth=do_auth, do_auth=do_auth,
) )
prev_state = context.current_state.get((event.type, event.state_key))
if not prev_state or prev_state.membership != Membership.JOIN:
user = UserID.from_string(event.user_id) user = UserID.from_string(event.user_id)
yield self.distributor.fire( yield self.distributor.fire(
"user_joined_room", user=user, room_id=room_id "user_joined_room", user=user, room_id=room_id