From 61f3c39cc2feadb002b25dad2eab07c1d712cebb Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 1 Apr 2022 15:56:16 +0300 Subject: [PATCH] Mark reactions as read when reading from Matrix --- CHANGELOG.md | 1 + mautrix_telegram/portal.py | 2 +- pyproject.toml | 1 + requirements.txt | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0ad7b29..4f85293f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ * Disabled file logging in Docker image by default. * If you want to enable it, set the `filename` in the file log handler to a path that is writable, then add `"file"` back to `logging.root.handlers`. +* Reactions are now marked as read when bridging read receipts from Matrix. ### Fixed * Fixed `!tg bridge` throwing error if the parameter is not an integer diff --git a/mautrix_telegram/portal.py b/mautrix_telegram/portal.py index f185c10f..9e4ddf26 100644 --- a/mautrix_telegram/portal.py +++ b/mautrix_telegram/portal.py @@ -1425,7 +1425,7 @@ class Portal(DBPortal, BasePortal): f"{message.mxid}/{message.tgid} as read by {user.mxid}/{user.tgid}" ) await user.client.send_read_acknowledge( - self.peer, max_id=message.tgid, clear_mentions=True + self.peer, max_id=message.tgid, clear_mentions=True, clear_reactions=True ) if self.peer_type == "channel" and not self.megagroup: asyncio.create_task(self._try_handle_read_for_sponsored_msg(user, event_id, timestamp)) diff --git a/pyproject.toml b/pyproject.toml index fe91da31..8e8c0133 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ force_to_top = "typing" from_first = true combine_as_imports = true known_first_party = "mautrix" +known_third_party = "telethon" line_length = 99 [tool.black] diff --git a/requirements.txt b/requirements.txt index 4a169e1a..13426e83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ yarl>=1,<2 mautrix>=0.15.4,<0.16 #telethon>=1.24,<1.25 # Fork to make session storage async and update to layer 138 -tulir-telethon==1.25.0a6 +tulir-telethon==1.25.0a7 asyncpg>=0.20,<0.26 mako>=1,<2 setuptools