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

Commit

Permalink
Merge pull request #4527 from matrix-org/erikj/fix_sending_remote_inv…
Browse files Browse the repository at this point in the history
…ite_rejections

Fix remote invite rejections not coming down sync
  • Loading branch information
erikjohnston authored Jan 30, 2019
2 parents 6587b0b + e25ab58 commit d534a27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/4527.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug when rejecting remote invites
14 changes: 13 additions & 1 deletion synapse/handlers/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1473,10 +1473,22 @@ def _get_rooms_changed(self, sync_result_builder, ignored_users):
if since_token and since_token.is_after(leave_token):
continue

# If this is an out of band message, like a remote invite
# rejection, we include it in the recents batch. Otherwise, we
# let _load_filtered_recents handle fetching the correct
# batches.
#
# This is all screaming out for a refactor, as the logic here is
# subtle and the moving parts numerous.
if leave_event.internal_metadata.is_out_of_band_membership():
batch_events = [leave_event]
else:
batch_events = None

room_entries.append(RoomSyncResultBuilder(
room_id=room_id,
rtype="archived",
events=None,
events=batch_events,
newly_joined=room_id in newly_joined_rooms,
full_state=False,
since_token=since_token,
Expand Down

0 comments on commit d534a27

Please sign in to comment.