Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Only fire user_joined_room if the user has actually joined. #410

Merged
merged 7 commits into from
Dec 2, 2015

Conversation

NegativeMjark
Copy link
Contributor

Synapse sends presence EDUs whenever a user joins the room. However it currently sends them whenever it sees a m.room.member event with membership join, even if the user was already joined to the room. This causes problems because setting the displayname results in a new join event for each room the user is a member of, which in turn will cause synapse to send an EDU for each remote server joined to each of those rooms.

This PR should fix this by only notifying if the user wasn't already joined to the room.

yield user_joined_room(self.distributor, user, event.room_id)
context = yield self.state_handler.compute_event_context(
event, old_state=state, outlier=event.internal_metadata.is_outlier()
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have the context as its returned by _handle_new_event (at line 180)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done c2c70f7

@erikjohnston
Copy link
Member

LGTM

NegativeMjark added a commit that referenced this pull request Dec 2, 2015
Only fire user_joined_room if the user has actually joined.
@NegativeMjark NegativeMjark merged commit 58d0927 into develop Dec 2, 2015
@erikjohnston erikjohnston deleted the markjh/edu_frequency branch January 12, 2016 16:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants