backfill: implement marking read

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-10-03 15:17:33 -06:00
parent 17e4e20a93
commit 57b32f6ac6
3 changed files with 13 additions and 6 deletions
+3
View File
@@ -94,6 +94,9 @@ func (t *TelegramClient) handleDialogs(ctx context.Context, dialogs tg.ModifiedM
log.Err(err).Msg("Failed to get portal")
continue
}
if dialog.UnreadCount == 0 && !dialog.UnreadMark {
portal.Metadata.(*PortalMetadata).ReadUpTo = dialog.TopMessage
}
// If this is a DM, make sure that the user isn't deleted.
if user, ok := dialog.Peer.(*tg.PeerUser); ok {