diff options
author | Patrick Cloke <patrickc@matrix.org> | 2022-05-26 15:52:41 -0400 |
---|---|---|
committer | Patrick Cloke <patrickc@matrix.org> | 2022-06-13 09:57:05 -0400 |
commit | 48b2d6c9ef6a98220c329df860c52ff34da2c3b7 (patch) | |
tree | 3689926c79a81be5a540dd35b4947a3593609434 | |
parent | Pass a Receipt into insert_receipt. (diff) | |
download | synapse-48b2d6c9ef6a98220c329df860c52ff34da2c3b7.tar.xz |
Create a separate RangedReadReceipt class.
-rw-r--r-- | synapse/replication/tcp/client.py | 4 | ||||
-rw-r--r-- | synapse/types.py | 20 |
2 files changed, 19 insertions, 5 deletions
diff --git a/synapse/replication/tcp/client.py b/synapse/replication/tcp/client.py index 2f59245058..bc784d5516 100644 --- a/synapse/replication/tcp/client.py +++ b/synapse/replication/tcp/client.py @@ -407,8 +407,8 @@ class FederationSenderHandler: receipt.room_id, receipt.receipt_type, receipt.user_id, - [receipt.event_id], - receipt.data, + event_ids=[receipt.event_id], + data=receipt.data, ) await self.federation_sender.send_read_receipt(receipt_info) diff --git a/synapse/types.py b/synapse/types.py index 0586d2cbb9..050e2f7c10 100644 --- a/synapse/types.py +++ b/synapse/types.py @@ -822,17 +822,31 @@ class ThirdPartyInstanceID: @attr.s(slots=True, frozen=True, auto_attribs=True) -class ReadReceipt: - """Information about a read-receipt""" +class Receipt: + """Information about a receipt""" room_id: str receipt_type: str user_id: str - event_ids: List[str] data: JsonDict @attr.s(slots=True, frozen=True, auto_attribs=True) +class ReadReceipt(Receipt): + """Information about a read-receipt""" + + event_ids: List[str] + + +@attr.s(slots=True, frozen=True, auto_attribs=True) +class RangedReadReceipt(Receipt): + """Information about a ranged read-receipt""" + + start_event_id: str + end_event_id: str + + +@attr.s(slots=True, frozen=True, auto_attribs=True) class DeviceListUpdates: """ An object containing a diff of information regarding other users' device lists, intended for |