This repository was archived by the owner on Apr 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1+ Fix a long-standing bug where invites from ignored users were included in incremental syncs.
Original file line number Diff line number Diff line change @@ -1771,6 +1771,7 @@ async def _get_rooms_changed(
17711771
17721772 if not non_joins :
17731773 continue
1774+ last_non_join = non_joins [- 1 ]
17741775
17751776 # Check if we have left the room. This can either be because we were
17761777 # joined before *or* that we since joined and then left.
@@ -1792,18 +1793,18 @@ async def _get_rooms_changed(
17921793 newly_left_rooms .append (room_id )
17931794
17941795 # Only bother if we're still currently invited
1795- should_invite = non_joins [ - 1 ] .membership == Membership .INVITE
1796+ should_invite = last_non_join .membership == Membership .INVITE
17961797 if should_invite :
1797- if event .sender not in ignored_users :
1798- invite_room_sync = InvitedSyncResult (room_id , invite = non_joins [ - 1 ] )
1798+ if last_non_join .sender not in ignored_users :
1799+ invite_room_sync = InvitedSyncResult (room_id , invite = last_non_join )
17991800 if invite_room_sync :
18001801 invited .append (invite_room_sync )
18011802
18021803 # Only bother if our latest membership in the room is knock (and we haven't
18031804 # been accepted/rejected in the meantime).
1804- should_knock = non_joins [ - 1 ] .membership == Membership .KNOCK
1805+ should_knock = last_non_join .membership == Membership .KNOCK
18051806 if should_knock :
1806- knock_room_sync = KnockedSyncResult (room_id , knock = non_joins [ - 1 ] )
1807+ knock_room_sync = KnockedSyncResult (room_id , knock = last_non_join )
18071808 if knock_room_sync :
18081809 knocked .append (knock_room_sync )
18091810
You can’t perform that action at this time.
0 commit comments