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

Commit ef86cf3

Browse files
Update _on_new_receipts() to work with MSC2285 changes. (#12636)
1 parent 07fa53e commit ef86cf3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

changelog.d/12636.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Implement [changes](https://github.com/matrix-org/matrix-spec-proposals/pull/2285/commits/4a77139249c2e830aec3c7d6bd5501a514d1cc27) to [MSC2285 (hidden read receipts)](https://github.com/matrix-org/matrix-spec-proposals/pull/2285). Contributed by @SimonBrandner.

synapse/replication/tcp/client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from twisted.internet.protocol import ReconnectingClientFactory
2222
from twisted.python.failure import Failure
2323

24-
from synapse.api.constants import EventTypes
24+
from synapse.api.constants import EventTypes, ReceiptTypes
2525
from synapse.federation import send_queue
2626
from synapse.federation.sender import FederationSender
2727
from synapse.logging.context import PreserveLoggingContext, make_deferred_yieldable
@@ -401,10 +401,8 @@ async def _on_new_receipts(
401401
# we only want to send on receipts for our own users
402402
if not self._is_mine_id(receipt.user_id):
403403
continue
404-
if (
405-
receipt.data.get("hidden", False)
406-
and self._hs.config.experimental.msc2285_enabled
407-
):
404+
# Private read receipts never get sent over federation.
405+
if receipt.receipt_type == ReceiptTypes.READ_PRIVATE:
408406
continue
409407
receipt_info = ReadReceipt(
410408
receipt.room_id,

0 commit comments

Comments
 (0)