Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix markMentionsRead() for albums and action messages #404

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Azq2
Copy link

@Azq2 Azq2 commented Jan 27, 2025

This PR fixes two related but independent issues.

  1. For “system” messages (ActionMessage) the markMentionsRead() is never called.

  2. For messages with albums (which actually consist of multiple messages), markMentionsRead() was called only for the first message, and not for all submessages.

Both these problems create problem, where unread mentions are just accumulated to infinity.

image

In my opinion, this is the most annoying bug in Telegram Web.

Copy link

netlify bot commented Jan 27, 2025

👷 Deploy request for telegram-tt-previews pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit b03c7b5

Comment on lines +855 to +861
unreadMentionsIds.push(message.id);
}

if (album) {
for (const albumMessage of album.messages) {
if (albumMessage.hasUnreadMention) {
unreadMentionsIds.push(albumMessage.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would duplicate the main message id in albums. You could make unreadMentionIds re-assignable and write it like

if (album) {
  unreadMentionIds = album.messages.filter((msg) => msg.hasUnreadMention).map((msg) => msg.id);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants