diff options
author | Patrick Cloke <patrickc@matrix.org> | 2022-07-14 13:47:44 -0400 |
---|---|---|
committer | Patrick Cloke <patrickc@matrix.org> | 2022-08-05 08:18:31 -0400 |
commit | 80dcb911dc9e3ba255440ae9c6a5c86210d8e9a5 (patch) | |
tree | 3161045b92b8c1c8a83fdcd46ae24388a8a03f96 | |
parent | Mark thread notifications as read. (diff) | |
download | synapse-80dcb911dc9e3ba255440ae9c6a5c86210d8e9a5.tar.xz |
Return thread receipts down sync.
-rw-r--r-- | synapse/storage/databases/main/receipts.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/synapse/storage/databases/main/receipts.py b/synapse/storage/databases/main/receipts.py index 238b6a8b91..683ee5e173 100644 --- a/synapse/storage/databases/main/receipts.py +++ b/synapse/storage/databases/main/receipts.py @@ -412,6 +412,7 @@ class ReceiptsWorkerStore(SQLBaseStore): "_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 @@ -427,6 +428,8 @@ class ReceiptsWorkerStore(SQLBaseStore): 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 [] |