Skip to content

Commit 5558fc7

Browse files
committed
Add more logs for own read receipts
1 parent 30a7121 commit 5558fc7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

mautrix_telegram/abstract_user.py

+5
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ async def update_own_read_receipt(
429429
if not puppet.is_real_user:
430430
return
431431

432+
self.log.debug("Handling own read receipt: %s", update)
432433
if isinstance(update, UpdateReadChannelInbox):
433434
portal = await po.Portal.get_by_tgid(TelegramID(update.channel_id))
434435
elif isinstance(update.peer, PeerChat):
@@ -442,13 +443,17 @@ async def update_own_read_receipt(
442443
return
443444

444445
if not portal or not portal.mxid:
446+
self.log.debug(f"Dropping own read receipt in unknown chat ({update.peer})")
445447
return
446448

447449
tg_space = portal.tgid if portal.peer_type == "channel" else self.tgid
448450
message = await DBMessage.get_one_by_tgid(
449451
TelegramID(update.max_id), tg_space, edit_index=-1
450452
)
451453
if not message:
454+
self.log.debug(
455+
f"Dropping own read receipt: unknown message {update.max_id}@{tg_space}"
456+
)
452457
return
453458

454459
await puppet.intent.mark_read(portal.mxid, message.mxid)

0 commit comments

Comments
 (0)