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

Commit

Permalink
Return the thread ID properly down sync. (#14159)
Browse files Browse the repository at this point in the history
A receipt's thread ID, if one exists, should be added to the
body of a receipt.
  • Loading branch information
clokep committed Oct 12, 2022
1 parent 87099b6 commit e6e876b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/14159.feature
Original file line number Diff line number Diff line change
@@ -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)).
2 changes: 2 additions & 0 deletions synapse/storage/databases/main/receipts.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ def f(txn: LoggingTransaction) -> List[Dict[str, Any]]:
# {"$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"])

Expand Down

0 comments on commit e6e876b

Please sign in to comment.