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 }
        let mutedKeys = UserDefaults(suiteName: "group.com.rosetta.dev")?
            .stringArray(forKey: "muted_chats_keys") ?? []
        if mutedKeys.contains(senderKey) { return true }
        return false
    }
}
