mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-01 00:04:17 -04:00
Accept & store thread IDs for receipts (implement MSC3771). (#13782)
Updates the `/receipts` endpoint and receipt EDU handler to parse a `thread_id` from the body and insert it in the database.
This commit is contained in:
parent
03c2bfb7f8
commit
efd108b45d
17 changed files with 173 additions and 41 deletions
|
@ -33,7 +33,12 @@ class ReceiptsStreamTestCase(BaseStreamTestCase):
|
|||
# tell the master to send a new receipt
|
||||
self.get_success(
|
||||
self.hs.get_datastores().main.insert_receipt(
|
||||
"!room:blue", "m.read", USER_ID, ["$event:blue"], {"a": 1}
|
||||
"!room:blue",
|
||||
"m.read",
|
||||
USER_ID,
|
||||
["$event:blue"],
|
||||
thread_id=None,
|
||||
data={"a": 1},
|
||||
)
|
||||
)
|
||||
self.replicate()
|
||||
|
@ -48,6 +53,7 @@ class ReceiptsStreamTestCase(BaseStreamTestCase):
|
|||
self.assertEqual("m.read", row.receipt_type)
|
||||
self.assertEqual(USER_ID, row.user_id)
|
||||
self.assertEqual("$event:blue", row.event_id)
|
||||
self.assertIsNone(row.thread_id)
|
||||
self.assertEqual({"a": 1}, row.data)
|
||||
|
||||
# Now let's disconnect and insert some data.
|
||||
|
@ -57,7 +63,12 @@ class ReceiptsStreamTestCase(BaseStreamTestCase):
|
|||
|
||||
self.get_success(
|
||||
self.hs.get_datastores().main.insert_receipt(
|
||||
"!room2:blue", "m.read", USER_ID, ["$event2:foo"], {"a": 2}
|
||||
"!room2:blue",
|
||||
"m.read",
|
||||
USER_ID,
|
||||
["$event2:foo"],
|
||||
thread_id=None,
|
||||
data={"a": 2},
|
||||
)
|
||||
)
|
||||
self.replicate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue