Add comments

This commit is contained in:
Mark Haines 2015-12-02 10:49:35 +00:00
parent 2a0ec3b89d
commit c30cdb0d68
2 changed files with 6 additions and 0 deletions

View file

@ -239,6 +239,9 @@ class FederationHandler(BaseHandler):
) )
prev_state = context.current_state.get((event.type, event.state_key)) prev_state = context.current_state.get((event.type, event.state_key))
if not prev_state or prev_state.membership != Membership.JOIN: if not prev_state or prev_state.membership != Membership.JOIN:
# Only fire user_joined_room if the user has acutally
# joined the room. Don't bother if the user is just
# changing their profile info.
user = UserID.from_string(event.state_key) user = UserID.from_string(event.state_key)
yield user_joined_room(self.distributor, user, event.room_id) yield user_joined_room(self.distributor, user, event.room_id)

View file

@ -527,6 +527,9 @@ class RoomMemberHandler(BaseHandler):
prev_state = context.current_state.get((event.type, event.state_key)) prev_state = context.current_state.get((event.type, event.state_key))
if not prev_state or prev_state.membership != Membership.JOIN: if not prev_state or prev_state.membership != Membership.JOIN:
# Only fire user_joined_room if the user has acutally joined the
# room. Don't bother if the user is just changing their profile
# info.
user = UserID.from_string(event.user_id) user = UserID.from_string(event.user_id)
yield user_joined_room(self.distributor, user, room_id) yield user_joined_room(self.distributor, user, room_id)