mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-13 22:34:05 +01:00
Update _on_new_receipts()
to work with MSC2285 changes. (#12636)
This commit is contained in:
parent
07fa53ec40
commit
ef86cf3d28
2 changed files with 4 additions and 5 deletions
1
changelog.d/12636.feature
Normal file
1
changelog.d/12636.feature
Normal file
|
@ -0,0 +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.
|
|
@ -21,7 +21,7 @@ from twisted.internet.interfaces import IAddress, IConnector
|
||||||
from twisted.internet.protocol import ReconnectingClientFactory
|
from twisted.internet.protocol import ReconnectingClientFactory
|
||||||
from twisted.python.failure import Failure
|
from twisted.python.failure import Failure
|
||||||
|
|
||||||
from synapse.api.constants import EventTypes
|
from synapse.api.constants import EventTypes, ReceiptTypes
|
||||||
from synapse.federation import send_queue
|
from synapse.federation import send_queue
|
||||||
from synapse.federation.sender import FederationSender
|
from synapse.federation.sender import FederationSender
|
||||||
from synapse.logging.context import PreserveLoggingContext, make_deferred_yieldable
|
from synapse.logging.context import PreserveLoggingContext, make_deferred_yieldable
|
||||||
|
@ -401,10 +401,8 @@ class FederationSenderHandler:
|
||||||
# we only want to send on receipts for our own users
|
# we only want to send on receipts for our own users
|
||||||
if not self._is_mine_id(receipt.user_id):
|
if not self._is_mine_id(receipt.user_id):
|
||||||
continue
|
continue
|
||||||
if (
|
# Private read receipts never get sent over federation.
|
||||||
receipt.data.get("hidden", False)
|
if receipt.receipt_type == ReceiptTypes.READ_PRIVATE:
|
||||||
and self._hs.config.experimental.msc2285_enabled
|
|
||||||
):
|
|
||||||
continue
|
continue
|
||||||
receipt_info = ReadReceipt(
|
receipt_info = ReadReceipt(
|
||||||
receipt.room_id,
|
receipt.room_id,
|
||||||
|
|
Loading…
Reference in a new issue