Skip to main content

decide_pending_notifications

Function decide_pending_notifications 

Source
pub fn decide_pending_notifications(
    previous_chats: Vec<ChatThreadSnapshot>,
    next_chats: Vec<ChatThreadSnapshot>,
    preferences: PreferencesSnapshot,
    app_foreground: bool,
    open_chat_id: Option<String>,
) -> Vec<NotificationCandidate>
Expand description

Compute the list of chats that should raise a notification given two successive AppState chat-list snapshots. Single source of truth for suppression — chat muted, chat open with app foregrounded, outgoing last message, no unread increase, or global pref off. Use this from Android, macOS, Linux, and Windows. iOS APNS uses a separate path that cannot suppress until Apple grants the filtering entitlement.