Fix typos, naming and copywright

This commit is contained in:
langleyd
2021-07-06 19:39:15 +01:00
parent f240fbf0d2
commit 8a2425aaa7
11 changed files with 17 additions and 17 deletions

View File

@@ -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.

View File

@@ -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 }
}

View File

@@ -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.

View File

@@ -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.

View File

@@ -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 {

View File

@@ -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.

View File

@@ -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.

View File

@@ -18,6 +18,6 @@ import Foundation
enum RoomNotificationState: CaseIterable {
case all
case mentionsOnly
case mentionsAndKeywordsOnly
case mute
}

View File

@@ -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

View File

@@ -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
}

View File

@@ -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)