Don't send delivery receipts to unencrypted private chat portals. Fixes #483

This commit is contained in:
Tulir Asokan
2020-10-09 16:50:12 +03:00
parent 522e33be12
commit a4595b427d
+3 -1
View File
@@ -833,7 +833,9 @@ class PortalMetadata(BasePortal, ABC):
async def _send_delivery_receipt(self, event_id: EventID, room_id: Optional[RoomID] = None async def _send_delivery_receipt(self, event_id: EventID, room_id: Optional[RoomID] = None
) -> 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: try:
await self.az.intent.mark_read(room_id or self.mxid, event_id) await self.az.intent.mark_read(room_id or self.mxid, event_id)
except Exception: except Exception: