From a4595b427d22d4483d6add31b3f2e4816f2dbd1d Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 9 Oct 2020 16:50:12 +0300 Subject: [PATCH] Don't send delivery receipts to unencrypted private chat portals. Fixes #483 --- mautrix_telegram/portal/metadata.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mautrix_telegram/portal/metadata.py b/mautrix_telegram/portal/metadata.py index 3432ef29..197baf87 100644 --- a/mautrix_telegram/portal/metadata.py +++ b/mautrix_telegram/portal/metadata.py @@ -833,7 +833,9 @@ async def _get_users(self, user: 'AbstractUser', async def _send_delivery_receipt(self, event_id: EventID, room_id: Optional[RoomID] = None ) -> None: - if event_id and config["bridge.delivery_receipts"]: + # TODO maybe check if the bot is in the room rather than assuming based on self.encrypted + if event_id and config["bridge.delivery_receipts"] and (self.encrypted + or self.peer_type != "user"): try: await self.az.intent.mark_read(room_id or self.mxid, event_id) except Exception: