resync: resync portals upon viewing if they haven't been synced in the last 24h (#124)

This commit is contained in:
Adam Van Ymeren
2025-09-25 12:34:41 -07:00
committed by GitHub
parent a280c3a4b9
commit a38c3e5d00
4 changed files with 61 additions and 16 deletions
+4 -1
View File
@@ -134,7 +134,10 @@ func (t *TelegramClient) handleDialogs(ctx context.Context, dialogs tg.ModifiedM
log.Debug().Int64("user_id", peer.UserID).Msg("Not syncing portal because user is deleted")
continue
}
chatInfo = t.getDMChatInfo(peer.UserID)
chatInfo, err = t.getDMChatInfo(ctx, peer.UserID)
if err != nil {
return fmt.Errorf("failed to get dm info for %d: %w", peer.UserID, err)
}
case *tg.PeerChat:
chat := chats[peer.ChatID]
if chat.TypeID() == tg.ChatForbiddenTypeID {