mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 14:38:28 +02:00
Fix typos, naming and copywright
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// File created from ScreenTemplate
|
||||
// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright 2021 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// File created from ScreenTemplate
|
||||
// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright 2021 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -23,7 +23,7 @@ protocol RoomNotificationSettingsCoordinatorDelegate: AnyObject {
|
||||
func roomNotificationSettingsCoordinatorDidCancel(_ coordinator: RoomNotificationSettingsCoordinatorType)
|
||||
}
|
||||
|
||||
/// `RoomNotificationSettingsCoordinatorType` is a protocol describing a Coordinator that handle key backup setup passphrase navigation flow.
|
||||
/// `RoomNotificationSettingsCoordinatorType` is a protocol describing a Coordinator that handles changes to the room navigation settings navigation flow.
|
||||
protocol RoomNotificationSettingsCoordinatorType: Coordinator, Presentable {
|
||||
var delegate: RoomNotificationSettingsCoordinatorDelegate? { get }
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// File created from ScreenTemplate
|
||||
// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright 2021 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// File created from ScreenTemplate
|
||||
// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright 2021 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// File created from ScreenTemplate
|
||||
// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright 2021 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -73,7 +73,7 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel
|
||||
// MARK: - Private
|
||||
|
||||
private static func mapNotificationStateOnRead(encrypted: Bool, state: RoomNotificationState) -> RoomNotificationState {
|
||||
if encrypted, case .mentionsOnly = state {
|
||||
if encrypted, case .mentionsAndKeywordsOnly = state {
|
||||
// Notifications not supported on encrypted rooms, map mentionsOnly to mute on read
|
||||
return .mute
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// File created from ScreenTemplate
|
||||
// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright 2021 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// File created from ScreenTemplate
|
||||
// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings
|
||||
/*
|
||||
Copyright 2020 New Vector Ltd
|
||||
Copyright 2021 New Vector Ltd
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -18,6 +18,6 @@ import Foundation
|
||||
|
||||
enum RoomNotificationState: CaseIterable {
|
||||
case all
|
||||
case mentionsOnly
|
||||
case mentionsAndKeywordsOnly
|
||||
case mute
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ fileprivate extension RoomNotificationState {
|
||||
switch self {
|
||||
case .all:
|
||||
return VectorL10n.roomNotifsSettingsAllMessages
|
||||
case .mentionsOnly:
|
||||
case .mentionsAndKeywordsOnly:
|
||||
return VectorL10n.roomNotifsSettingsMentionsAndKeywords
|
||||
case .mute:
|
||||
return VectorL10n.roomNotifsSettingsNone
|
||||
|
||||
@@ -65,7 +65,7 @@ final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType
|
||||
switch state {
|
||||
case .all:
|
||||
allMessages(completion: completion)
|
||||
case .mentionsOnly:
|
||||
case .mentionsAndKeywordsOnly:
|
||||
mentionsOnly(completion: completion)
|
||||
case .mute:
|
||||
mute(completion: completion)
|
||||
@@ -277,7 +277,7 @@ fileprivate extension MXRoom {
|
||||
return .mute
|
||||
}
|
||||
if isMentionsOnly {
|
||||
return .mentionsOnly
|
||||
return .mentionsAndKeywordsOnly
|
||||
}
|
||||
return .all
|
||||
}
|
||||
@@ -119,10 +119,10 @@ class RoomNotificationSettingsViewModelTests: XCTestCase {
|
||||
viewModel.process(viewAction: .load)
|
||||
XCTAssertNotNil(view.viewState)
|
||||
XCTAssertTrue(view.viewState!.notificationState == .all)
|
||||
viewModel.process(viewAction: .selectNotificationState(.mentionsOnly))
|
||||
XCTAssertTrue(view.viewState!.notificationState == .mentionsOnly)
|
||||
viewModel.process(viewAction: .selectNotificationState(.mentionsAndKeywordsOnly))
|
||||
XCTAssertTrue(view.viewState!.notificationState == .mentionsAndKeywordsOnly)
|
||||
viewModel.process(viewAction: .save)
|
||||
XCTAssertTrue(service.notificationState == .mentionsOnly)
|
||||
XCTAssertTrue(service.notificationState == .mentionsAndKeywordsOnly)
|
||||
XCTAssertTrue(coordinator.didComplete)
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class RoomNotificationSettingsViewModelTests: XCTestCase {
|
||||
}
|
||||
|
||||
func testMentionsOnlyNotAvaileOnEncryptedRoom() throws {
|
||||
service = MockRoomNotificationSettingsService(initialState: .mentionsOnly)
|
||||
service = MockRoomNotificationSettingsService(initialState: .mentionsAndKeywordsOnly)
|
||||
setupViewModel(roomEncrypted: true, showAvatar: false)
|
||||
|
||||
viewModel.process(viewAction: .load)
|
||||
|
||||
Reference in New Issue
Block a user