Files
bundesmessenger-ios/RiotSwiftUI/Modules/Settings/Notifications/Model/NotificationSettingsScreen.swift
T
2025-01-23 12:19:12 +01:00

36 lines
1.1 KiB
Swift

//
// Copyright 2021-2024 New Vector Ltd.
//
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
// Please see LICENSE files in the repository root for full details.
//
import Foundation
/// The notification settings screen definitions, used when calling the coordinator.
@objc enum NotificationSettingsScreen: Int {
case defaultNotifications
case mentionsAndKeywords
case other
}
extension NotificationSettingsScreen: CaseIterable { }
extension NotificationSettingsScreen: Identifiable {
var id: Int { rawValue }
}
extension NotificationSettingsScreen {
/// Defines which rules are handled by each of the screens.
var pushRules: [NotificationPushRuleId] {
switch self {
case .defaultNotifications:
return [.oneToOneRoom, .allOtherMessages, .oneToOneEncryptedRoom, .encrypted]
case .mentionsAndKeywords:
return [.containDisplayName, .containUserName, .roomNotif, .keywords]
case .other:
return [.inviteMe, .call, .suppressBots, .tombstone]
}
}
}