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

Commit

Permalink
Return thread receipts down sync.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Aug 16, 2022
1 parent 8b6d839 commit d35ee33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions synapse/storage/databases/main/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def f(txn: LoggingTransaction) -> List[Dict[str, Any]]:
"_get_linearized_receipts_for_rooms", f
)

# Map of room ID to a dictionary in the form that sync wants it.
results: JsonDict = {}
for row in txn_results:
# We want a single event per room, since we want to batch the
Expand All @@ -426,6 +427,8 @@ def f(txn: LoggingTransaction) -> List[Dict[str, Any]]:
receipt_type = event_entry.setdefault(row["receipt_type"], {})

receipt_type[row["user_id"]] = db_to_json(row["data"])
if row["thread_id"]:
receipt_type[row["user_id"]]["thread_id"] = row["thread_id"]

results = {
room_id: [results[room_id]] if room_id in results else []
Expand Down

0 comments on commit d35ee33

Please sign in to comment.