Don't count removed chat photos in the profile gallery
dallo28 committed
- Author
- dallo28 · dallo28@users.noreply.github.comOct 23, 2026 at 12:26
- Committer
- dallo28 · dallo28@users.noreply.github.comOct 23, 2026 at 12:26
- Parents
- 0aae959806c5
Don't count removed chat photos in the profile gallery For groups and channels the photo history comes from messages.search with inputMessagesFilterChatPhotos. The results also include messageActionChatDeletePhoto service messages, which carry no photo and are included in the returned count. They were skipped but still counted, so the gallery made a page for each one. Those pages never load and show as black or loading images. Skip any result without a real photo and subtract it from the count. Only subtract when one response holds the whole history: with several pages, each would subtract only its own skipped results, the totals would differ between pages and onLoaded() would rebuild the list, dropping photos that were already loaded.
1 file changed+7−1