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

Commit

Permalink
Rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
richvdh committed Feb 28, 2022
1 parent be4da86 commit f005eb2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions synapse/handlers/federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,19 +1006,18 @@ async def get_state_ids_for_pdu(self, room_id: str, event_id: str) -> List[str]:
# get_state_groups_ids should return exactly one result
assert len(state_groups) == 1

_, state = list(state_groups.items()).pop()
results = state
_, state_map = list(state_groups.items()).pop()

if event.is_state():
# Get previous state
if "replaces_state" in event.unsigned:
prev_id = event.unsigned["replaces_state"]
if prev_id != event.event_id:
results[(event.type, event.state_key)] = prev_id
state_map[(event.type, event.state_key)] = prev_id
else:
results.pop((event.type, event.state_key), None)
state_map.pop((event.type, event.state_key), None)

return list(results.values())
return list(state_map.values())

async def on_backfill_request(
self, origin: str, room_id: str, pdu_list: List[str], limit: int
Expand Down

0 comments on commit f005eb2

Please sign in to comment.