Return the thread ID properly down sync. (#14159)

A receipt's thread ID, if one exists, should be added to the
body of a receipt.
This commit is contained in:
Patrick Cloke 2022-10-12 12:18:34 -04:00
parent 87099b6ea5
commit e6e876b9b1
2 changed files with 3 additions and 0 deletions

View File

@ -0,0 +1 @@
Support for thread-specific notifications & receipts ([MSC3771](https://github.com/matrix-org/matrix-spec-proposals/pull/3771) and [MSC3773](https://github.com/matrix-org/matrix-spec-proposals/pull/3773)).

View File

@ -416,6 +416,8 @@ class ReceiptsWorkerStore(SQLBaseStore):
# {"$foo:bar": { "read": { "@user:host": <receipt> }, .. }, .. }
event_entry = room_event["content"].setdefault(row["event_id"], {})
receipt_type = event_entry.setdefault(row["receipt_type"], {})
if row["thread_id"]:
receipt_type[row["user_id"]]["thread_id"] = row["thread_id"]
receipt_type[row["user_id"]] = db_to_json(row["data"])