Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use telethon's send_read_acknowledge instead of raw methods
  • Loading branch information
tulir committed Aug 5, 2019
1 parent bd13c73 commit 8536bdd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
16 changes: 16 additions & 0 deletions .isort.cfg
@@ -0,0 +1,16 @@
[settings]
line_length=99
indent=4

multi_line_output=5

sections=FUTURE,STDLIB,THIRDPARTY,TELETHON,MAUTRIX,FIRSTPARTY,LOCALFOLDER
no_lines_before=LOCALFOLDER
default_section=FIRSTPARTY

known_thirdparty=aiohttp,sqlalchemy,alembic,commonmark,ruamel.yaml,PIL,moviepy,prometheus_client,yarl,mako,pkg_resources
known_telethon=telethon,alchemysession,cryptg
known_mautrix=mautrix

balanced_wrapping=True
length_sort=True
7 changes: 2 additions & 5 deletions mautrix_telegram/portal/portal_matrix.py
Expand Up @@ -124,11 +124,8 @@ async def mark_read(self, user: 'u.User', event_id: EventID) -> None:
message = DBMessage.get_by_mxid(event_id, self.mxid, space)
if not message:
return
if self.peer_type == "channel":
await user.client(ReadChannelHistoryRequest(
channel=await self.get_input_entity(user), max_id=message.tgid))
else:
await user.client(ReadMessageHistoryRequest(peer=self.peer, max_id=message.tgid))
await user.client.send_read_acknowledge(self.peer, max_id=message.tgid,
clear_mentions=True)

async def kick_matrix(self, user: Union['u.User', 'p.Puppet'], source: 'u.User',
ban: bool = False) -> None:
Expand Down

0 comments on commit 8536bdd

Please sign in to comment.