mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 16:13:42 +02:00
Configured and applied SwiftFormat
This commit is contained in:
committed by
Stefan Ceriu
parent
ff2e6ddfa7
commit
43c28d23b7
+5
-6
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -14,12 +14,11 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import DesignKit
|
||||
import Foundation
|
||||
|
||||
// Conformance of MXPushRule to the abstraction `NotificationPushRule` for use in `NotificationSettingsViewModel`.
|
||||
extension MXPushRule: NotificationPushRuleType {
|
||||
|
||||
/// Given a rule, check it match the actions in the static definition.
|
||||
/// - Parameter standardActions: The standard actions to match against.
|
||||
/// - Returns: Wether `this` rule matches the standard actions.
|
||||
@@ -27,7 +26,7 @@ extension MXPushRule: NotificationPushRuleType {
|
||||
guard let standardActions = standardActions else {
|
||||
return false
|
||||
}
|
||||
if !enabled && standardActions == .disabled {
|
||||
if !enabled, standardActions == .disabled {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -75,10 +74,10 @@ extension MXPushRule: NotificationPushRuleType {
|
||||
}
|
||||
|
||||
var notify: Bool {
|
||||
return getAction(actionType: MXPushRuleActionTypeNotify) != nil
|
||||
getAction(actionType: MXPushRuleActionTypeNotify) != nil
|
||||
}
|
||||
|
||||
var dontNotify: Bool {
|
||||
return getAction(actionType: MXPushRuleActionTypeDontNotify) != nil
|
||||
getAction(actionType: MXPushRuleActionTypeDontNotify) != nil
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -20,6 +20,6 @@ struct MockNotificationPushRule: NotificationPushRuleType {
|
||||
var ruleId: String!
|
||||
var enabled: Bool
|
||||
func matches(standardActions: NotificationStandardActions?) -> Bool {
|
||||
return false
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -33,11 +33,11 @@ extension NotificationIndex {
|
||||
/// - Parameter enabled: Enabled/Disabled state.
|
||||
/// - Returns: The associated NotificationIndex
|
||||
static func index(when enabled: Bool) -> NotificationIndex {
|
||||
return enabled ? .noisy : .off
|
||||
enabled ? .noisy : .off
|
||||
}
|
||||
|
||||
/// Used to map from the checked state back to the index.
|
||||
var enabled: Bool {
|
||||
return self != .off
|
||||
self != .off
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
extension NotificationPushRuleId {
|
||||
/// A static definition of the push rule actions.
|
||||
///
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -32,7 +32,6 @@ enum NotificationPushRuleId: String {
|
||||
case keywords = "_keywords"
|
||||
}
|
||||
|
||||
|
||||
extension NotificationPushRuleId: Identifiable {
|
||||
var id: String {
|
||||
rawValue
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -26,7 +26,7 @@ import Foundation
|
||||
extension NotificationSettingsScreen: CaseIterable { }
|
||||
|
||||
extension NotificationSettingsScreen: Identifiable {
|
||||
var id: Int { self.rawValue }
|
||||
var id: Int { rawValue }
|
||||
}
|
||||
|
||||
extension NotificationSettingsScreen {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//
|
||||
//
|
||||
// Copyright 2021 New Vector Ltd
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
|
||||
Reference in New Issue
Block a user