Skip to content

Ignore reactions and the read status of the blocked users#358

Closed
nekohy wants to merge 4 commits into
risin42:devfrom
nekohy:ignore-reaction
Closed

Ignore reactions and the read status of the blocked users#358
nekohy wants to merge 4 commits into
risin42:devfrom
nekohy:ignore-reaction

Conversation

@nekohy
Copy link
Copy Markdown
Contributor

@nekohy nekohy commented May 12, 2026

忽略掉被屏蔽用户的已读状态和点击reaction

Summary by CodeRabbit

  • New Features

    • Added dialog filtering modes to organize your conversation list: All, Related, or Unread.
    • Blocked and filtered peers are now properly excluded from message reactions and read receipt displays.
    • New menu option to quickly cycle between dialog filter modes.
  • Localization

    • Added Chinese language support for dialog filter settings.

Review Change Stack

@nekohy nekohy closed this May 12, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 922e661b-1a15-4764-9a93-9d6087a4b404

📥 Commits

Reviewing files that changed from the base of the PR and between e3e4419 and 1a17e80.

📒 Files selected for processing (10)
  • TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java
  • TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedHeaderView.java
  • TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedUsersListView.java
  • TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java
  • TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java
  • TMessagesProj/src/main/java/tw/nekomimi/nekogram/helpers/MessageHelper.java
  • TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt
  • TMessagesProj/src/main/res/drawable/outline_unread_24.xml
  • TMessagesProj/src/main/res/values-zh-rCN/strings_nax.xml
  • TMessagesProj/src/main/res/values/strings_nax.xml

Walkthrough

This PR adds two independent features to the Telegram client: (1) filtered/blocked peer filtering applied to message reactions and message-seen participants across multiple UI components, and (2) a configurable dialogs filter mode enabling users to show All, Related, or Unread conversations via a menu toggle.

Changes

Blocked/Filtered Peer Filtering in Reactions and Message Views

Layer / File(s) Summary
MessageHelper peer filtering API
TMessagesProj/src/main/java/tw/nekomimi/nekogram/helpers/MessageHelper.java
New isBlockedOrFilteredPeer(long) checks peer block/filter status; isBlockedOrFiltered(TLRPC.Message) now uses the peer helper. New filterBlockedMessageReactions(TLRPC.TL_messageReactions) removes reactions from recent/top lists and decrements aggregate counts via decrementReactionCount(...) and sameReaction(...) helpers for blocked/filtered reaction peers.
MessagesController reaction filtering on update
TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java
Private helper filterBlockedMessageReactions(dialogId, reactions) applies MessageHelper filtering to reactions for megagroup dialogs when ignoreBlocked is enabled; called at two sites in the TL_updateMessageReactions update handler before persisting reactions.
ReactedHeaderView reaction filtering
TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedHeaderView.java
Filters blocked/filtered supergroup peers from read-participant responses and reaction lists using new shouldFilterBlockedPeer(...) and filterBlockedReactionPeers(...) helpers; applied when collecting read participants, computing reaction counts, and adding user/chat reactions to the view.
ReactedUsersListView seen-users and reaction filtering
TMessagesProj/src/main/java/org/telegram/ui/Components/ReactedUsersListView.java
Filters blocked/filtered peers from setSeenUsers(...) and load(...) paths using new helpers to skip blocked peers when initializing seen reactions and building the reactions list.
MessageSeenView participant filtering
TMessagesProj/src/main/java/org/telegram/ui/MessageSeenView.java
Filters blocked/filtered megagroup peers from read-participant collections using new shouldFilterBlockedPeer(chat, peerId) helper in both TL_readParticipantDate and Long peer-ID parsing branches.

Dialogs Filter Mode Feature

Layer / File(s) Summary
Filter mode configuration
TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt
New dialogsFilterMode integer config property (key "DialogsFilterMode", default 0) persists the selected dialogs filter mode.
Dialog filtering logic
TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java
Defines mode constants (0=All, 1=Related, 2=Unread) and filtering implementation via filterDialogsByMode(...), isDialogVisibleForMode(...), and unread predicates (hasRelatedUnread, hasUnread, hasUnmutedUnread). Applied in getDialogsArray(...) for both default dialog list and folder-filter tabs when DialogFilter is missing.
Notification and refresh hooks
TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java
Wires unread-counter notifications and updateInterfaces (when UPDATE_MASK_READ_DIALOG_MESSAGE is set) to call refreshDialogsForDialogFilterMode() for real-time dialog visibility updates.
Menu option to cycle filter mode
TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java
Adds options-menu entry that cycles the filter mode (All → Related → Unread → All), updating NaConfig and triggering dialog list refresh.
UI resources and strings
TMessagesProj/src/main/res/drawable/outline_unread_24.xml, TMessagesProj/src/main/res/values/strings_nax.xml, TMessagesProj/src/main/res/values-zh-rCN/strings_nax.xml
Adds outline_unread_24 vector drawable icon and English/Chinese string resources (ShowAllDialogs, ShowUnreadDialogs, ShowRelatedDialogs) for menu labels.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.42.2)
TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java
TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant