import Foundation

/// Foreground notification suppression logic.
/// Determines whether a notification should be silenced (active chat or muted).
enum InAppNotificationManager {

    /// Returns `true` if the notification should be suppressed (no banner).
    static func shouldSuppress(senderKey: String) -> Bool {
        if senderKey.isEmpty { return true }
        if MessageRepository.shared.isDialogActive(senderKey) { return true }
        // PERF: use in-memory dialog state instead of UserDefaults I/O per notification check.
        if DialogRepository.shared.dialogs[senderKey]?.isMuted == true { return true }
        return false
    }
}
