Skip to content
Snippets Groups Projects
Unverified Commit d534a27f authored by Erik Johnston's avatar Erik Johnston Committed by GitHub
Browse files

Merge pull request #4527 from matrix-org/erikj/fix_sending_remote_invite_rejections

Fix remote invite rejections not coming down sync
parents 6587b0b8 e25ab58c
No related branches found
No related tags found
No related merge requests found
Fix bug when rejecting remote invites
...@@ -1473,10 +1473,22 @@ class SyncHandler(object): ...@@ -1473,10 +1473,22 @@ class SyncHandler(object):
if since_token and since_token.is_after(leave_token): if since_token and since_token.is_after(leave_token):
continue 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_entries.append(RoomSyncResultBuilder(
room_id=room_id, room_id=room_id,
rtype="archived", rtype="archived",
events=None, events=batch_events,
newly_joined=room_id in newly_joined_rooms, newly_joined=room_id in newly_joined_rooms,
full_state=False, full_state=False,
since_token=since_token, since_token=since_token,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment