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

Commit b7a66e3

Browse files
committed
Destructure output tuples into named variables
1 parent 55f587c commit b7a66e3

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

synapse/storage/databases/main/event_push_actions.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -538,15 +538,15 @@ def get_push_actions_txn(
538538

539539
notifs = [
540540
HttpPushAction(
541-
event_id=row[0],
542-
room_id=row[1],
543-
stream_ordering=row[2],
544-
actions=_deserialize_action(row[3], row[4]),
541+
event_id=event_id,
542+
room_id=room_id,
543+
stream_ordering=stream_ordering,
544+
actions=_deserialize_action(actions, highlight),
545545
)
546-
for row in push_actions
546+
for event_id, room_id, stream_ordering, actions, highlight in push_actions
547547
# Only include push actions with a stream ordering after any receipt, or without any
548548
# receipt present (invited to but never read rooms).
549-
if row[2] > receipts_by_room.get(row[1], 0)
549+
if stream_ordering > receipts_by_room.get(room_id, 0)
550550
]
551551

552552
# Now sort it so it's ordered correctly, since currently it will
@@ -615,16 +615,16 @@ def get_push_actions_txn(
615615
# Make a list of dicts from the two sets of results.
616616
notifs = [
617617
EmailPushAction(
618-
event_id=row[0],
619-
room_id=row[1],
620-
stream_ordering=row[2],
621-
actions=_deserialize_action(row[3], row[4]),
622-
received_ts=row[5],
618+
event_id=event_id,
619+
room_id=room_id,
620+
stream_ordering=stream_ordering,
621+
actions=_deserialize_action(actions, highlight),
622+
received_ts=received_ts,
623623
)
624-
for row in push_actions
624+
for event_id, room_id, stream_ordering, actions, highlight, received_ts in push_actions
625625
# Only include push actions with a stream ordering after any receipt, or without any
626626
# receipt present (invited to but never read rooms).
627-
if row[2] > receipts_by_room.get(row[1], 0)
627+
if stream_ordering > receipts_by_room.get(room_id, 0)
628628
]
629629

630630
# Now sort it so it's ordered correctly, since currently it will

0 commit comments

Comments
 (0)