From 6f74b79f1ba9cd77cd68705987186cea97485f15 Mon Sep 17 00:00:00 2001 From: langleyd Date: Tue, 22 Jun 2021 13:39:50 +0100 Subject: [PATCH 01/72] Add new settings notification feature flag and update ui entry point --- Config/BuildSettings.swift | 1 + Riot/Assets/en.lproj/Vector.strings | 1 + Riot/Generated/Strings.swift | 4 ++++ .../Room/RoomInfo/RoomInfoCoordinator.swift | 7 +++++- .../RoomInfoList/RoomInfoListViewAction.swift | 22 ++++++++----------- .../RoomInfoListViewController.swift | 10 +++++++-- .../Settings/RoomSettingsViewController.m | 5 ++++- 7 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index 3cfcf65dc..0d5ae6dae 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -295,6 +295,7 @@ final class BuildSettings: NSObject { static let roomSettingsScreenShowFlairSettings: Bool = true static let roomSettingsScreenShowAdvancedSettings: Bool = true static let roomSettingsScreenAdvancedShowEncryptToVerifiedOption: Bool = true + static let roomSettingsScreenShowNotificationsV2: Bool = false // MARK: - Room Member Screen diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 234022cf2..d7abe10a2 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -710,6 +710,7 @@ Tap the + to start adding people."; "room_details_topic" = "Topic"; "room_details_favourite_tag" = "Favourite"; "room_details_low_priority_tag" = "Low priority"; +"room_details_notifs" = "Notifications"; "room_details_mute_notifs" = "Mute notifications"; "room_details_direct_chat" = "Direct Chat"; "room_details_access_section"="Who can access this room?"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index ba05c0233..cb5875969 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -2710,6 +2710,10 @@ internal enum VectorL10n { internal static var roomDetailsNoLocalAddressesForDm: String { return VectorL10n.tr("Vector", "room_details_no_local_addresses_for_dm") } + /// Notifications + internal static var roomDetailsNotifs: String { + return VectorL10n.tr("Vector", "room_details_notifs") + } /// Members internal static var roomDetailsPeople: String { return VectorL10n.tr("Vector", "room_details_people") diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift b/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift index f1efb7577..27252f4d7 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift @@ -152,8 +152,13 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType { self.navigationRouter.push(search, animated: animated, popCompletion: nil) } }) + case .notifications: + break default: - segmentedViewController.selectedIndex = target.tabIndex + guard let tabIndex = target.tabIndex else { + fatalError("No settings tab index for this target.") + } + segmentedViewController.selectedIndex = tabIndex if case .settings(let roomSettingsField) = target { roomSettingsViewController?.selectedRoomSettingsField = roomSettingsField diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewAction.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewAction.swift index 945d2844a..c6e0c8887 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewAction.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewAction.swift @@ -24,25 +24,21 @@ enum RoomInfoListTarget: Equatable { case uploads case integrations case search - - var tabIndex: UInt { - let tabIndex: UInt - + case notifications + + var tabIndex: UInt? { switch self { case .members: - tabIndex = 0 + return 0 case .uploads: - tabIndex = 1 + return 1 case .settings: - tabIndex = 2 - case .integrations: - tabIndex = 3 - case .search: - tabIndex = 4 + return 2 + default: + return nil } - - return tabIndex } + } /// RoomInfoListViewController view actions exposed to view model diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift index bfc3396bf..28e1f64e8 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift @@ -150,6 +150,9 @@ final class RoomInfoListViewController: UIViewController { let rowSettings = Row(type: .default, icon: Asset.Images.settingsIcon.image, text: VectorL10n.roomDetailsSettings, accessoryType: .disclosureIndicator) { self.viewModel.process(viewAction: .navigate(target: .settings())) } + let roomNotifications = Row(type: .default, icon: Asset.Images.roomActionNotification.image, text: VectorL10n.roomDetailsNotifs, accessoryType: .disclosureIndicator) { + self.viewModel.process(viewAction: .navigate(target: .notifications)) + } let text = viewData.numberOfMembers == 1 ? VectorL10n.roomInfoListOneMember : VectorL10n.roomInfoListSeveralMembers(String(viewData.numberOfMembers)) let rowMembers = Row(type: .default, icon: Asset.Images.userIcon.image, text: text, accessoryType: .disclosureIndicator) { self.viewModel.process(viewAction: .navigate(target: .members)) @@ -165,8 +168,11 @@ final class RoomInfoListViewController: UIViewController { } var rows = [rowSettings] - if (RiotSettings.shared.roomInfoScreenShowIntegrations) - { + + if BuildSettings.roomSettingsScreenShowNotificationsV2 { + rows.append(roomNotifications) + } + if RiotSettings.shared.roomInfoScreenShowIntegrations { rows.append(rowIntegrations) } rows.append(rowMembers) diff --git a/Riot/Modules/Room/Settings/RoomSettingsViewController.m b/Riot/Modules/Room/Settings/RoomSettingsViewController.m index 634468fe8..08d18f655 100644 --- a/Riot/Modules/Room/Settings/RoomSettingsViewController.m +++ b/Riot/Modules/Room/Settings/RoomSettingsViewController.m @@ -528,7 +528,10 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti { [sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_DIRECT_CHAT]; } - [sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_MUTE_NOTIFICATIONS]; + if (!BuildSettings.roomSettingsScreenShowNotificationsV2) + { + [sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_MUTE_NOTIFICATIONS]; + } [sectionMain addRowWithTag:ROOM_SETTINGS_MAIN_SECTION_ROW_LEAVE]; [tmpSections addObject:sectionMain]; From c554e48ad2d0bced2119d4fb0eec43da63f1aa3f Mon Sep 17 00:00:00 2001 From: langleyd Date: Tue, 22 Jun 2021 16:01:21 +0100 Subject: [PATCH 02/72] Add correct asset for notifications icon. --- .../Room/notifications.imageset/Contents.json | 23 ++++++++++++++++++ .../notifications.imageset/notifications.png | Bin 0 -> 451 bytes .../notifications@2x.png | Bin 0 -> 704 bytes .../notifications@3x.png | Bin 0 -> 1018 bytes Riot/Generated/Images.swift | 1 + .../RoomInfoListViewController.swift | 2 +- 6 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Riot/Assets/Images.xcassets/Room/notifications.imageset/Contents.json create mode 100644 Riot/Assets/Images.xcassets/Room/notifications.imageset/notifications.png create mode 100644 Riot/Assets/Images.xcassets/Room/notifications.imageset/notifications@2x.png create mode 100644 Riot/Assets/Images.xcassets/Room/notifications.imageset/notifications@3x.png diff --git a/Riot/Assets/Images.xcassets/Room/notifications.imageset/Contents.json b/Riot/Assets/Images.xcassets/Room/notifications.imageset/Contents.json new file mode 100644 index 000000000..66a053751 --- /dev/null +++ b/Riot/Assets/Images.xcassets/Room/notifications.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "notifications.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "notifications@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "notifications@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Riot/Assets/Images.xcassets/Room/notifications.imageset/notifications.png b/Riot/Assets/Images.xcassets/Room/notifications.imageset/notifications.png new file mode 100644 index 0000000000000000000000000000000000000000..6b100741dba3ec599789d048f69da4520c94f25a GIT binary patch literal 451 zcmV;!0X+VRP)E^QJJ=(}B;`N{^W{|zuxKM~{TKC+o@ZFMhpm)#BV#Q-n z?=bU0o(+?sGv?xOtpiqILFl!M$rJn*tQYM-zi6U@-NX>lZQE`7oLqwwg!<|tp*=Ui tJuqPnTF2QO0nthPO$1}4=`s8jUH}*JWhs``LO=ij002ovPDHLkV1hh%xxfGb literal 0 HcmV?d00001 diff --git a/Riot/Assets/Images.xcassets/Room/notifications.imageset/notifications@2x.png b/Riot/Assets/Images.xcassets/Room/notifications.imageset/notifications@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..98d86c1524d37baa514d9599393ebd428b05244f GIT binary patch literal 704 zcmV;x0zdtUP)8^F3SBnt+*3bY3xSu;(t%TSncfp!g?Ams*d0&)Yg%%rg% zmS+M??WB?|*@p4AamKb{eb$pDJpnc4Lh!)&>~a8B!|3l@OnffF&FJM(e*q6P;F!rQ zXfyM4`)-J-r)0Ao{XBpN1RSH#=-oU=j4nLkB!nhG(85}F6^Q{ccXa3^pG4o3QeP!+ zrY^%Nx4_@=Zd%4=zsM}0V?B!PAV+vC85o^Bdo)E3G6}>TRW#;N@iy`zXn6eeaD;C&yb*jZ7UcH2toJZpO#uTdo~4(1SV%e$6M^*KoH-vy5HockYyVM!IlG~kpL;` zpfJc!A1IK2Ucic4ploV^vZ)2irWPohN($Iasm%mrAyet!Y*r29x!0`%dL`yFvzCUC zFkT<;70^w|viS)Gqw}e+XCJ#J_wE#k(IT!^_rT-uW%}?K4+`2|i%?o8o7y5z; zS0cRb?@B`^1me_*-|RyMctL7&kS37~p~_WWLv1CR57MqA1ay<3fz;=nRbm8d)cjbDxf>49`X^l1jn5< mO4eQ}sD~#svqo0000-;-mv%k%`z4N6Z?I6>1joq;U+x8mmlB!rEh%EwaglOM-~d)qEIu5x zh(&86mAdoJLtt+py1U-$bjDzb$^^xOL6h#HHDc7B7Uabdh5K4ubG-fG?Fm#&>4Gvb zNwfi+Z;D^nghJ3r{ETjuqDmDc>kKg%%&RqeR5!|%R;1(pSxgMC%*&CWsA1vFUjJ+p zO2&8u$&})g@FH)W(T0hXd$-zyk}xVLt2dMI3aTEWOO#|Z#jMDYaO&=VJ>P*6FeWJb z18q+3grwd6_cj>DNQ&(po~|QfE-Vek$R{sNj&4RG2pN_V-WoJHi()WHVL{W}#}+sO z0<}M9>pU|Qk08$1!7*51E}{zwlC{UB=y^cS!Q_+!3{WhB0=5Q@!fzW!X4%?;Ak&jXXF1qIO-B!<%#I1W$K!cnd*hywN;oCjM_ z5UY1J>VOxdzzb5~1u5`?6nH@jydVW$kOD7AffuB}3sT?(De!_6ctHxhAO&8K0{xC6 zk<&eC2@9ZbQ%_4!d^A`pzMZaoh_LWx1}#Bp8kD}X%Mi_?x1n?I?wD@j4R4?>APzCS zU(wx4oGXH+avE1qCq%8}_o4Q^`h_Ftj~r}44IzL77EOA2BWWQ)`$y*+K)hRr!aSdB zpLLIrPFR?bkfpq0t{@pT@}Ux^@4;&z1Rb+5-4>sIswB;Q)eCx>#l9r-F8^_euX@wSD(u_8!5GMOZ7W!mAJ0m4weJOC_X_5DHFS`UJ*SXRG)ti3{G oF$EYR;N|wm)i2=jcpf{y0nrRFH_^PjYybcN07*qoM6N<$g2(*E8vp Date: Fri, 25 Jun 2021 22:38:31 +0100 Subject: [PATCH 03/72] Add NotificationRepository, ViewModel and ViewController --- Riot/Generated/Storyboards.swift | 5 + .../RoomNotifcationsRepository.swift | 339 ++++++++++++++++++ .../RoomNotificationSettingsCoordinator.swift | 68 ++++ ...mNotificationSettingsCoordinatorType.swift | 29 ++ .../RoomNotificationSettingsViewAction.swift | 26 ++ ...ificationSettingsViewController.storyboard | 52 +++ ...omNotificationSettingsViewController.swift | 274 ++++++++++++++ .../RoomNotificationSettingsViewModel.swift | 75 ++++ ...oomNotificationSettingsViewModelType.swift | 37 ++ .../RoomNotificationSettingsViewState.swift | 30 ++ .../Room/RoomInfo/RoomInfoCoordinator.swift | 22 +- 11 files changed, 956 insertions(+), 1 deletion(-) create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinatorType.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewAction.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.storyboard create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift diff --git a/Riot/Generated/Storyboards.swift b/Riot/Generated/Storyboards.swift index c66d40f6a..0b77710ce 100644 --- a/Riot/Generated/Storyboards.swift +++ b/Riot/Generated/Storyboards.swift @@ -172,6 +172,11 @@ internal enum StoryboardScene { internal static let initialScene = InitialSceneType(storyboard: RoomInfoListViewController.self) } + internal enum RoomNotificationSettingsViewController: StoryboardType { + internal static let storyboardName = "RoomNotificationSettingsViewController" + + internal static let initialScene = InitialSceneType(storyboard: RoomNotificationSettingsViewController.self) + } internal enum SecretsRecoveryWithKeyViewController: StoryboardType { internal static let storyboardName = "SecretsRecoveryWithKeyViewController" diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift new file mode 100644 index 000000000..ad69f504f --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift @@ -0,0 +1,339 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation + +enum RoomNotificationState: CaseIterable { + case all + case mentionsOnly + case mute +} + +protocol RoomNotificationRepository { + typealias Completion = () -> Void + typealias NotificationSettingCallback = (RoomNotificationState) -> Void + + func observeNotificationState(listener: @escaping NotificationSettingCallback) + func update(state: RoomNotificationState, completion: @escaping Completion) + var notificationState: RoomNotificationState { get } +} + +final class RoomNotificationRepositoryImpl: RoomNotificationRepository { + + // MARK: - Properties + + // MARK: Private + + private let room: MXRoom + + private var notificationCenterDidUpdateObserver: NSObjectProtocol? + private var notificationCenterDidFailObserver: NSObjectProtocol? + + private var observers: [ObjectIdentifier] = [] + + // MARK: Public + + var notificationState: RoomNotificationState { + room.notificationState + } + + // MARK: - Setup + + init(room: MXRoom) { + self.room = room + } + + deinit { + observers.forEach(NotificationCenter.default.removeObserver) + } + + // MARK: - Public + + func observeNotificationState(listener: @escaping NotificationSettingCallback) { + + let observer = NotificationCenter.default.addObserver( + forName: NSNotification.Name(rawValue: kMXNotificationCenterDidUpdateRules), + object: nil, + queue: OperationQueue.main) { [weak self] _ in + guard let self = self else { return } + listener(self.room.notificationState) + } + observers += [ObjectIdentifier(observer)] + } + + + func update(state: RoomNotificationState, completion: @escaping Completion) { + switch state { + case .all: + allMessages(completion: completion) + case .mentionsOnly: + mentionsOnly(completion: completion) + case .mute: + mute(completion: completion) + } + } + + // MARK: - Private + + private func mute(completion: @escaping Completion) { + guard !room.isMuted else { + completion() + return + } + + if let rule = room.roomPushRule, room.isMentionsOnly { + removePushRule(rule: rule) { + self.mute(completion: completion) + } + return + } + + guard let rule = room.overridePushRule else { + self.addPushRuleToMute(completion: completion) + return + } + + guard notificationCenterDidUpdateObserver == nil else { + MXLog.debug("[MXRoom+Riot] Request in progress: ignore push rule update") + completion() + return + } + + // if the user defined one, use it + if rule.actionsContains(actionType: MXPushRuleActionTypeDontNotify) { + enablePushRule(rule: rule, completion: completion) + } else { + removePushRule(rule: rule) { + self.addPushRuleToMute(completion: completion) + } + } + } + + private func mentionsOnly(completion: @escaping Completion) { + guard !room.isMentionsOnly else { + completion() + return + } + + if let rule = room.overridePushRule, room.isMuted { + removePushRule(rule: rule) { + self.mentionsOnly(completion: completion) + } + return + } + + guard let rule = room.roomPushRule else { + addPushRuleToMentionOnly(completion: completion) + return + } + + guard notificationCenterDidUpdateObserver == nil else { + MXLog.debug("[MXRoom+Riot] Request in progress: ignore push rule update") + completion() + return + } + + // if the user defined one, use it + if rule.actionsContains(actionType: MXPushRuleActionTypeDontNotify) { + enablePushRule(rule: rule, completion: completion) + } else { + removePushRule(rule: rule) { + self.addPushRuleToMentionOnly(completion: completion) + } + } + + } + + private func allMessages(completion: @escaping Completion) { + if !room.isMentionsOnly && !room.isMuted { + completion() + return + } + + if let rule = room.overridePushRule, room.isMuted { + removePushRule(rule: rule) { + self.allMessages(completion: completion) + } + return + } + + if let rule = room.roomPushRule, room.isMentionsOnly { + removePushRule(rule: rule, completion: completion) + } + } + + private func addPushRuleToMentionOnly(completion: @escaping Completion) { + handleUpdateCallback(completion) { [weak self] in + guard let self = self else { return true } + return self.room.roomPushRule != nil + } + handleFailureCallback(completion) + + room.mxSession.notificationCenter.addRoomRule( + room.roomId, + notify: false, + sound: false, + highlight: false) + } + + private func addPushRuleToMute(completion: @escaping Completion) { + guard let roomId = room.roomId else { + return + } + handleUpdateCallback(completion) { [weak self] in + guard let self = self else { return true } + return self.room.overridePushRule != nil + } + handleFailureCallback(completion) + + room.mxSession.notificationCenter.addOverrideRule( + withId: roomId, + conditions: [["kind": "event_match", "key": "room_id", "pattern": roomId]], + notify: false, + sound: false, + highlight: false + ) + } + + + private func removePushRule(rule: MXPushRule, completion: @escaping Completion) { + handleUpdateCallback(completion) { [weak self] in + guard let self = self else { return true } + return self.room.mxSession.notificationCenter.rule(byId: rule.ruleId) == nil + } + handleFailureCallback(completion) + + room.mxSession.notificationCenter.removeRule(rule) + } + + private func enablePushRule(rule: MXPushRule, completion: @escaping Completion) { + handleUpdateCallback(completion) { + // No way to check whether this notification concerns the push rule. Consider the change is applied. + return true + } + handleFailureCallback(completion) + + room.mxSession.notificationCenter.enableRule(rule, isEnabled: true) + } + + private func handleUpdateCallback(_ completion: @escaping Completion, releaseCheck: @escaping () -> Bool) { + notificationCenterDidUpdateObserver = NotificationCenter.default.addObserver( + forName: NSNotification.Name(rawValue: kMXNotificationCenterDidUpdateRules), + object: nil, + queue: OperationQueue.main) { [weak self] _ in + guard let self = self else { return } + if releaseCheck() { + self.removeObservers() + completion() + } + } + } + + private func handleFailureCallback(_ completion: @escaping Completion) { + notificationCenterDidFailObserver = NotificationCenter.default.addObserver( + forName: NSNotification.Name(rawValue: kMXNotificationCenterDidFailRulesUpdate), + object: nil, + queue: OperationQueue.main) { [weak self] _ in + guard let self = self else { return } + self.removeObservers() + completion() + } + } + + func removeObservers() { + if let observer = self.notificationCenterDidUpdateObserver { + NotificationCenter.default.removeObserver(observer) + self.notificationCenterDidUpdateObserver = nil + } + + if let observer = self.notificationCenterDidFailObserver { + NotificationCenter.default.removeObserver(observer) + self.notificationCenterDidFailObserver = nil + } + } +} + +// We could move these to their own file and make available in global namespace or move to sdk but they are only used here at the moment +fileprivate extension MXRoom { + + typealias Completion = () -> Void + func getRoomRule(from rules: [Any]) -> MXPushRule? { + guard let pushRules = rules as? [MXPushRule] else { + return nil + } + + return pushRules.first(where: { self.roomId == $0.ruleId }) + } + + var overridePushRule: MXPushRule? { + getRoomRule(from: mxSession.notificationCenter.rules.global.override) + } + + var roomPushRule: MXPushRule? { + getRoomRule(from: mxSession.notificationCenter.rules.global.room) + } + + var notificationState: RoomNotificationState { + if isMuted { + return .mute + } + if isMentionsOnly { + return .mentionsOnly + } + return .all + } + + var isMuted: Bool { + // Check whether an override rule has been defined with the roomm id as rule id. + // This kind of rule is created to mute the room + guard let rule = self.overridePushRule, + rule.actionsContains(actionType: MXPushRuleActionTypeDontNotify), + rule.conditionIsEnabled(kind: .eventMatch, for: roomId) else { + return false + } + return rule.enabled + } + + var isMentionsOnly: Bool { + // Check push rules at room level + guard let rule = roomPushRule else { return false } + return rule.enabled && rule.actionsContains(actionType: MXPushRuleActionTypeDontNotify) + } + +} + +fileprivate extension MXPushRule { + func actionsContains(actionType: MXPushRuleActionType) -> Bool { + guard let actions = actions as? [MXPushRuleAction] else { + return false + } + return actions.contains(where: { $0.actionType == actionType }) + } + + func conditionIsEnabled(kind: MXPushRuleConditionType, for roomId: String) -> Bool { + guard let conditions = conditions as? [MXPushRuleCondition] else { + return false + } + let ruleContainsCondition = conditions.contains { condition in + guard case kind = MXPushRuleConditionType(identifier: condition.kind), + let key = condition.parameters["key"] as? String, + let pattern = condition.parameters["pattern"] as? String + else { return false } + return key == "room_id" && pattern == roomId + } + return ruleContainsCondition && enabled + } +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift new file mode 100644 index 000000000..dca1ff315 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift @@ -0,0 +1,68 @@ +// File created from ScreenTemplate +// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings +/* + Copyright 2020 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation +import UIKit + +final class RoomNotificationSettingsCoordinator: RoomNotificationSettingsCoordinatorType { + + // MARK: - Properties + + // MARK: Private + private var roomNotificationSettingsViewModel: RoomNotificationSettingsViewModelType + private let roomNotificationSettingsViewController: RoomNotificationSettingsViewController + + // MARK: Public + + // Must be used only internally + var childCoordinators: [Coordinator] = [] + + weak var delegate: RoomNotificationSettingsCoordinatorDelegate? + + // MARK: - Setup + + init(room: MXRoom) { + let repository = RoomNotificationRepositoryImpl(room: room) + let roomNotificationSettingsViewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: repository) + let roomNotificationSettingsViewController = RoomNotificationSettingsViewController.instantiate(with: roomNotificationSettingsViewModel) + self.roomNotificationSettingsViewModel = roomNotificationSettingsViewModel + self.roomNotificationSettingsViewController = roomNotificationSettingsViewController + } + + // MARK: - Public methods + + func start() { + self.roomNotificationSettingsViewModel.coordinatorDelegate = self + } + + func toPresentable() -> UIViewController { + return self.roomNotificationSettingsViewController + } +} + +// MARK: - RoomNotificationSettingsViewModelCoordinatorDelegate +extension RoomNotificationSettingsCoordinator: RoomNotificationSettingsViewModelCoordinatorDelegate { + + func roomNotificationSettingsViewModelDidComplete(_ viewModel: RoomNotificationSettingsViewModelType) { + self.delegate?.roomNotificationSettingsCoordinatorDidComplete(self) + } + + func roomNotificationSettingsViewModelDidCancel(_ viewModel: RoomNotificationSettingsViewModelType) { + self.delegate?.roomNotificationSettingsCoordinatorDidCancel(self) + } +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinatorType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinatorType.swift new file mode 100644 index 000000000..99e30f617 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinatorType.swift @@ -0,0 +1,29 @@ +// File created from ScreenTemplate +// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings +/* + Copyright 2020 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol RoomNotificationSettingsCoordinatorDelegate: AnyObject { + func roomNotificationSettingsCoordinatorDidComplete(_ coordinator: RoomNotificationSettingsCoordinatorType) + func roomNotificationSettingsCoordinatorDidCancel(_ coordinator: RoomNotificationSettingsCoordinatorType) +} + +/// `RoomNotificationSettingsCoordinatorType` is a protocol describing a Coordinator that handle key backup setup passphrase navigation flow. +protocol RoomNotificationSettingsCoordinatorType: Coordinator, Presentable { + var delegate: RoomNotificationSettingsCoordinatorDelegate? { get } +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewAction.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewAction.swift new file mode 100644 index 000000000..ee6539614 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewAction.swift @@ -0,0 +1,26 @@ +// File created from ScreenTemplate +// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings +/* + Copyright 2020 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation +/// RoomNotificationSettingsViewController view actions exposed to view model +enum RoomNotificationSettingsViewAction { + case load + case selectNotificationState(RoomNotificationState) + case save + case cancel +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.storyboard b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.storyboard new file mode 100644 index 000000000..8d49ce878 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.storyboard @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift new file mode 100644 index 000000000..4c5282f6d --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -0,0 +1,274 @@ +// File created from ScreenTemplate +// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings +/* + Copyright 2020 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import UIKit + +final class RoomNotificationSettingsViewController: UIViewController { + + // MARK: - Properties + private enum Constants { + static let plainStyleCellReuseIdentifier = "plain" + static let linkToAccountSettings = "linkToAccountSettings" + } + // MARK: Outlets + + @IBOutlet private weak var mainTableView: UITableView! + + // MARK: Private + + private var viewModel: RoomNotificationSettingsViewModelType! + private var theme: Theme! + private var errorPresenter: MXKErrorPresentation! + private var activityPresenter: ActivityIndicatorPresenter! + + private enum RowType { + case plain + } + + private struct Row { + var type: RowType + var setting: RoomNotificationState + var text: String? + var accessoryType: UITableViewCell.AccessoryType = .none + var action: (() -> Void)? + } + + private struct Section { + var header: String? + var rows: [Row] + var footer: NSAttributedString? + } + + private var sections: [Section] = [] { + didSet { + mainTableView.reloadData() + } + } + + private var viewState: RoomNotificationSettingsViewState! + + // MARK: - Setup + + class func instantiate(with viewModel: RoomNotificationSettingsViewModelType) -> RoomNotificationSettingsViewController { + let viewController = StoryboardScene.RoomNotificationSettingsViewController.initialScene.instantiate() + viewController.viewModel = viewModel + viewController.theme = ThemeService.shared().theme + return viewController + } + + // MARK: - Life cycle + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + + setupViews() + activityPresenter = ActivityIndicatorPresenter() + errorPresenter = MXKErrorAlertPresentation() + + registerThemeServiceDidChangeThemeNotification() + update(theme: theme) + + viewModel.viewDelegate = self + viewModel.process(viewAction: .load) + } + + override var preferredStatusBarStyle: UIStatusBarStyle { + return theme.statusBarStyle + } + + // MARK: - Private + + private func update(theme: Theme) { + self.theme = theme + + view.backgroundColor = theme.headerBackgroundColor + mainTableView.backgroundColor = theme.headerBackgroundColor + + if let navigationBar = navigationController?.navigationBar { + theme.applyStyle(onNavigationBar: navigationBar) + } + } + + private func registerThemeServiceDidChangeThemeNotification() { + NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .themeServiceDidChangeTheme, object: nil) + } + + @objc private func themeDidChange() { + update(theme: ThemeService.shared().theme) + } + + private func setupViews() { + let doneBarButtonItem = MXKBarButtonItem(title: "Done", style: .plain) { [weak self] in + self?.viewModel.process(viewAction: .save) + } + + let cancelBarButtonItem = MXKBarButtonItem(title: "Cancel", style: .plain) { [weak self] in + self?.viewModel.process(viewAction: .cancel) + } + + if navigationController?.navigationBar.backItem == nil { + navigationItem.leftBarButtonItem = cancelBarButtonItem + } + navigationItem.rightBarButtonItem = doneBarButtonItem + } + + private func render(viewState: RoomNotificationSettingsViewState) { + + if viewState.saving { + activityPresenter.presentActivityIndicator(on: view, animated: true) + } else { + activityPresenter.removeCurrentActivityIndicator(animated: true) + } + self.viewState = viewState + updateSections() + } + + private func updateSections() { + let rows = RoomNotificationState.allCases.map({ (setting) -> Row in + return Row(type: .plain, + setting: setting, + text: setting.title, + accessoryType: viewState.notificationState == setting ? .checkmark : .none, + action: { + self.viewModel.process(viewAction: .selectNotificationState(setting)) + }) + }) + + let formatStr = "You can manage keywords in the %@" + let linkStr = "Account Settings" + let formattedStr = String(format: formatStr, arguments: [linkStr]) + + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.lineHeightMultiple = 1.16 + let footer_0 = NSMutableAttributedString(string: formattedStr, attributes: [ + NSAttributedString.Key.kern: -0.08, + NSAttributedString.Key.paragraphStyle: paragraphStyle, + NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0) + ]) + let linkRange = (footer_0.string as NSString).range(of: linkStr) + footer_0.addAttribute(NSAttributedString.Key.link, value: Constants.linkToAccountSettings, range: linkRange) + let section0 = Section(header: nil, rows: rows, footer: footer_0) + + sections = [ + section0 + ] + } +} + +// MARK - UITableViewDataSource +extension RoomNotificationSettingsViewController: UITableViewDataSource { + + func numberOfSections(in tableView: UITableView) -> Int { + return sections.count + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return sections[section].rows.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let row = sections[indexPath.section].rows[indexPath.row] + + switch row.type { + case .plain: + var cell: UITableViewCell! = tableView.dequeueReusableCell(withIdentifier: Constants.plainStyleCellReuseIdentifier) + if cell == nil { + cell = UITableViewCell(style: .value1, reuseIdentifier: Constants.plainStyleCellReuseIdentifier) + } + cell.textLabel?.font = .systemFont(ofSize: 17) + cell.detailTextLabel?.font = .systemFont(ofSize: 16) + cell.textLabel?.text = row.text + if row.accessoryType == .checkmark { + cell.accessoryView = UIImageView(image: Asset.Images.checkmark.image) + } else { + cell.accessoryView = nil + cell.accessoryType = row.accessoryType + } + cell.textLabel?.textColor = theme.textPrimaryColor + cell.detailTextLabel?.textColor = theme.textSecondaryColor + cell.backgroundColor = theme.backgroundColor + cell.contentView.backgroundColor = .clear + cell.tintColor = theme.tintColor + return cell + } + } + +} + +// MARK - UITableViewDelegate +extension RoomNotificationSettingsViewController: UITableViewDelegate { + + func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { + cell.backgroundColor = theme.backgroundColor + cell.selectedBackgroundView = UIView() + cell.selectedBackgroundView?.backgroundColor = theme.selectedBackgroundColor + } + + func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { + return sections[section].header + } + + func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? { + return sections[section].footer?.string + } + +// func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { +// if sections[section].footer == nil { +// return nil +// } +// +// let view = tableView.dequeueReusableHeaderFooterView(RiotTableViewHeaderFooterView.self) +// +// view?.textView.attributedText = sections[section].footer +// view?.update(theme: theme) +// view?.delegate = self +// +// return view +// } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + + let row = sections[indexPath.section].rows[indexPath.row] + row.action?() + } + +} + +// MARK: - RoomNotificationSettingsViewModelViewDelegate +extension RoomNotificationSettingsViewController: RoomNotificationSettingsViewModelViewDelegate { + + func roomNotificationSettingsViewModel(_ viewModel: RoomNotificationSettingsViewModelType, didUpdateViewState viewSate: RoomNotificationSettingsViewState) { + render(viewState: viewSate) + } +} + +extension RoomNotificationState { + var title: String { + switch self { + case .all: + return "All Messages" + case .mentionsOnly: + return "Mentions and Keywords only" + case .mute: + return "None" + } + } +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift new file mode 100644 index 000000000..ec59d2b70 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift @@ -0,0 +1,75 @@ +// File created from ScreenTemplate +// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings +/* + Copyright 2020 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + + +final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModelType { + + // MARK: - Properties + + // MARK: Private + + private let roomNotificationRepository: RoomNotificationRepository + private var state: RoomNotificationSettingsViewStateImpl { + willSet { + update(viewState: newValue) + } + } + // MARK: Public + + weak var viewDelegate: RoomNotificationSettingsViewModelViewDelegate? + + weak var coordinatorDelegate: RoomNotificationSettingsViewModelCoordinatorDelegate? + + // MARK: - Setup + + init(roomNotificationRepository: RoomNotificationRepository) { + self.roomNotificationRepository = roomNotificationRepository + self.state = RoomNotificationSettingsViewStateImpl(saving: false, notificationState: roomNotificationRepository.notificationState) + self.roomNotificationRepository.observeNotificationState { state in + self.state.notificationState = state + } + } + + // MARK: - Public + + func process(viewAction: RoomNotificationSettingsViewAction) { + switch viewAction { + case .load: + update(viewState: self.state) + case .selectNotificationState(let state): + self.state.notificationState = state + case .save: + self.state.saving = true + roomNotificationRepository.update(state: state.notificationState) { [weak self] in + guard let self = self else { return } + self.state.saving = false + self.coordinatorDelegate?.roomNotificationSettingsViewModelDidComplete(self) + } + case .cancel: + coordinatorDelegate?.roomNotificationSettingsViewModelDidCancel(self) + } + } + + // MARK: - Private + + private func update(viewState: RoomNotificationSettingsViewState) { + self.viewDelegate?.roomNotificationSettingsViewModel(self, didUpdateViewState: viewState) + } +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift new file mode 100644 index 000000000..8ec944ade --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift @@ -0,0 +1,37 @@ +// File created from ScreenTemplate +// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings +/* + Copyright 2020 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +protocol RoomNotificationSettingsViewModelViewDelegate: AnyObject { + func roomNotificationSettingsViewModel(_ viewModel: RoomNotificationSettingsViewModelType, didUpdateViewState viewSate: RoomNotificationSettingsViewState) +} + +protocol RoomNotificationSettingsViewModelCoordinatorDelegate: AnyObject { + func roomNotificationSettingsViewModelDidComplete(_ viewModel: RoomNotificationSettingsViewModelType) + func roomNotificationSettingsViewModelDidCancel(_ viewModel: RoomNotificationSettingsViewModelType) +} + +/// Protocol describing the view model used by `RoomNotificationSettingsViewController` +protocol RoomNotificationSettingsViewModelType { + + var viewDelegate: RoomNotificationSettingsViewModelViewDelegate? { get set } + var coordinatorDelegate: RoomNotificationSettingsViewModelCoordinatorDelegate? { get set } + + func process(viewAction: RoomNotificationSettingsViewAction) +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift new file mode 100644 index 000000000..3677004d4 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift @@ -0,0 +1,30 @@ +// File created from ScreenTemplate +// $ createScreen.sh Room/NotificationSettings RoomNotificationSettings +/* + Copyright 2020 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. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + */ + +import Foundation + +/// RoomNotificationSettingsViewController view state +struct RoomNotificationSettingsViewStateImpl: RoomNotificationSettingsViewState { + var saving: Bool + var notificationState: RoomNotificationState +} + +protocol RoomNotificationSettingsViewState { + var saving: Bool { get } + var notificationState: RoomNotificationState { get } +} diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift b/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift index 27252f4d7..5776bccbd 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift @@ -137,6 +137,12 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType { return coordinator } + private func createRoomNotificationSettingsCoordinator() -> RoomNotificationSettingsCoordinator { + let coordinator = RoomNotificationSettingsCoordinator(room: room) + coordinator.delegate = self + return coordinator + } + private func showRoomDetails(with target: RoomInfoListTarget, animated: Bool) { switch target { case .integrations: @@ -153,7 +159,10 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType { } }) case .notifications: - break + let coordinator = createRoomNotificationSettingsCoordinator() + coordinator.start() + self.add(childCoordinator: coordinator) + self.navigationRouter.push(coordinator, animated: true, popCompletion: nil) default: guard let tabIndex = target.tabIndex else { fatalError("No settings tab index for this target.") @@ -189,3 +198,14 @@ extension RoomInfoCoordinator: RoomParticipantsViewControllerDelegate { } } + +extension RoomInfoCoordinator: RoomNotificationSettingsCoordinatorDelegate { + func roomNotificationSettingsCoordinatorDidComplete(_ coordinator: RoomNotificationSettingsCoordinatorType) { + self.navigationRouter.popModule(animated: true) + } + + func roomNotificationSettingsCoordinatorDidCancel(_ coordinator: RoomNotificationSettingsCoordinatorType) { + + } + +} From 38095ab151425f6b1d6e459952d13fe6de56e3ae Mon Sep 17 00:00:00 2001 From: manuroe Date: Wed, 30 Jun 2021 16:55:28 +0200 Subject: [PATCH 04/72] Prepare for new sprint --- CHANGES.rst | 24 ++++++++++++++++++++++++ Config/AppIdentifiers.xcconfig | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 29c0a6b44..2e72d9c8e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,27 @@ +Changes to be released in next version +================================================= + +✨ Features + * + +🙌 Improvements + * + +🐛 Bugfix + * + +⚠️ API Changes + * + +🗣 Translations + * + +🧱 Build + * + +Others + * + Changes in 1.4.4 (2021-06-30) ================================================= diff --git a/Config/AppIdentifiers.xcconfig b/Config/AppIdentifiers.xcconfig index a56c9e00a..391931749 100644 --- a/Config/AppIdentifiers.xcconfig +++ b/Config/AppIdentifiers.xcconfig @@ -22,8 +22,8 @@ APPLICATION_GROUP_IDENTIFIER = group.im.vector APPLICATION_SCHEME = element // Version -MARKETING_VERSION = 1.4.4 -CURRENT_PROJECT_VERSION = 1.4.4 +MARKETING_VERSION = 1.4.5 +CURRENT_PROJECT_VERSION = 1.4.5 // Team From c60093a4eee7b2e12ecde92cf968b49f53c99064 Mon Sep 17 00:00:00 2001 From: langleyd Date: Fri, 2 Jul 2021 10:15:35 +0100 Subject: [PATCH 05/72] Add translations, footer message and room encryption handling --- Riot/Assets/en.lproj/Vector.strings | 11 ++++++ Riot/Generated/Strings.swift | 32 +++++++++++++++++ .../RoomNotifcationsRepository.swift | 1 + .../RoomNotificationSettingsCoordinator.swift | 2 +- ...omNotificationSettingsViewController.swift | 34 ++++++++++-------- .../RoomNotificationSettingsViewModel.swift | 35 ++++++++++++++++--- .../RoomNotificationSettingsViewState.swift | 10 ++++++ 7 files changed, 105 insertions(+), 20 deletions(-) diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index d7abe10a2..7f307756d 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -773,6 +773,17 @@ Tap the + to start adding people."; "room_details_copy_room_address" = "Copy Room Address"; "room_details_copy_room_url" = "Copy Room URL"; +// Room Notification Settings +"room_notifs_settings_all_messages" = "All Messages"; +"room_notifs_settings_mentions_and_keywords" = "Mentions and Keywords only"; +"room_notifs_settings_none" = "None"; +"room_notifs_settings_done_action" = "Done"; +"room_notifs_settings_cancel_action" = "Cancel"; +"room_notifs_settings_manage_notifications" = "You can manage notifications in %@"; +"room_notifs_settings_account_settings" = "Account settings"; +"room_notifs_settings_encryed_room_notice" = "\nPlease note that mentions & keyword notifications are not available in encrypted rooms on mobile."; + + // Group Details "group_details_title" = "Community Details"; "group_details_home" = "Home"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index cb5875969..9e4f80e92 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -3022,6 +3022,38 @@ internal enum VectorL10n { internal static var roomNoPrivilegesToCreateGroupCall: String { return VectorL10n.tr("Vector", "room_no_privileges_to_create_group_call") } + /// Account settings + internal static var roomNotifsSettingsAccountSettings: String { + return VectorL10n.tr("Vector", "room_notifs_settings_account_settings") + } + /// All Messages + internal static var roomNotifsSettingsAllMessages: String { + return VectorL10n.tr("Vector", "room_notifs_settings_all_messages") + } + /// Cancel + internal static var roomNotifsSettingsCancelAction: String { + return VectorL10n.tr("Vector", "room_notifs_settings_cancel_action") + } + /// Done + internal static var roomNotifsSettingsDoneAction: String { + return VectorL10n.tr("Vector", "room_notifs_settings_done_action") + } + /// \nPlease note that mentions & keyword notifications are not available in encrypted rooms on mobile. + internal static var roomNotifsSettingsEncryedRoomNotice: String { + return VectorL10n.tr("Vector", "room_notifs_settings_encryed_room_notice") + } + /// You can manage notifications in %@ + internal static func roomNotifsSettingsManageNotifications(_ p1: String) -> String { + return VectorL10n.tr("Vector", "room_notifs_settings_manage_notifications", p1) + } + /// Mentions and Keywords only + internal static var roomNotifsSettingsMentionsAndKeywords: String { + return VectorL10n.tr("Vector", "room_notifs_settings_mentions_and_keywords") + } + /// None + internal static var roomNotifsSettingsNone: String { + return VectorL10n.tr("Vector", "room_notifs_settings_none") + } /// Connectivity to the server has been lost. internal static var roomOfflineNotification: String { return VectorL10n.tr("Vector", "room_offline_notification") diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift index ad69f504f..de7571668 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift @@ -287,6 +287,7 @@ fileprivate extension MXRoom { } var notificationState: RoomNotificationState { + if isMuted { return .mute } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift index dca1ff315..41c9d6c17 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift @@ -38,7 +38,7 @@ final class RoomNotificationSettingsCoordinator: RoomNotificationSettingsCoordin init(room: MXRoom) { let repository = RoomNotificationRepositoryImpl(room: room) - let roomNotificationSettingsViewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: repository) + let roomNotificationSettingsViewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: repository, roomEncrypted: room.summary.isEncrypted) let roomNotificationSettingsViewController = RoomNotificationSettingsViewController.instantiate(with: roomNotificationSettingsViewModel) self.roomNotificationSettingsViewModel = roomNotificationSettingsViewModel self.roomNotificationSettingsViewController = roomNotificationSettingsViewController diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index 4c5282f6d..3948bbc6b 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -115,11 +115,11 @@ final class RoomNotificationSettingsViewController: UIViewController { } private func setupViews() { - let doneBarButtonItem = MXKBarButtonItem(title: "Done", style: .plain) { [weak self] in + let doneBarButtonItem = MXKBarButtonItem(title: VectorL10n.roomNotifsSettingsDoneAction, style: .plain) { [weak self] in self?.viewModel.process(viewAction: .save) } - let cancelBarButtonItem = MXKBarButtonItem(title: "Cancel", style: .plain) { [weak self] in + let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.roomNotifsSettingsCancelAction, style: .plain) { [weak self] in self?.viewModel.process(viewAction: .cancel) } @@ -141,7 +141,7 @@ final class RoomNotificationSettingsViewController: UIViewController { } private func updateSections() { - let rows = RoomNotificationState.allCases.map({ (setting) -> Row in + let rows = viewState.notificationOptions.map({ (setting) -> Row in return Row(type: .plain, setting: setting, text: setting.title, @@ -151,20 +151,26 @@ final class RoomNotificationSettingsViewController: UIViewController { }) }) - let formatStr = "You can manage keywords in the %@" - let linkStr = "Account Settings" + let linkStr = VectorL10n.roomNotifsSettingsAccountSettings + let formatStr = VectorL10n.roomNotifsSettingsManageNotifications(linkStr) + let formattedStr = String(format: formatStr, arguments: [linkStr]) - + let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineHeightMultiple = 1.16 - let footer_0 = NSMutableAttributedString(string: formattedStr, attributes: [ + let paragraphAttributes: [NSAttributedString.Key: Any] = [ NSAttributedString.Key.kern: -0.08, NSAttributedString.Key.paragraphStyle: paragraphStyle, NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0) - ]) - let linkRange = (footer_0.string as NSString).range(of: linkStr) - footer_0.addAttribute(NSAttributedString.Key.link, value: Constants.linkToAccountSettings, range: linkRange) - let section0 = Section(header: nil, rows: rows, footer: footer_0) + ] + let footer0 = NSMutableAttributedString(string: formattedStr, attributes: paragraphAttributes) + let linkRange = (footer0.string as NSString).range(of: linkStr) + footer0.addAttribute(NSAttributedString.Key.link, value: Constants.linkToAccountSettings, range: linkRange) + + if viewState.roomEncrypted { + footer0.append(NSAttributedString(string: VectorL10n.roomNotifsSettingsEncryedRoomNotice, attributes: paragraphAttributes)) + } + let section0 = Section(header: nil, rows: rows, footer: footer0) sections = [ section0 @@ -264,11 +270,11 @@ extension RoomNotificationState { var title: String { switch self { case .all: - return "All Messages" + return VectorL10n.roomNotifsSettingsAllMessages case .mentionsOnly: - return "Mentions and Keywords only" + return VectorL10n.roomNotifsSettingsMentionsAndKeywords case .mute: - return "None" + return VectorL10n.roomNotifsSettingsNone } } } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift index ec59d2b70..00e90dbd0 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift @@ -39,11 +39,15 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel // MARK: - Setup - init(roomNotificationRepository: RoomNotificationRepository) { + init(roomNotificationRepository: RoomNotificationRepository, roomEncrypted: Bool) { self.roomNotificationRepository = roomNotificationRepository - self.state = RoomNotificationSettingsViewStateImpl(saving: false, notificationState: roomNotificationRepository.notificationState) - self.roomNotificationRepository.observeNotificationState { state in - self.state.notificationState = state + + let notificationState = Self.mapNotificationStateOnRead(encrypted: roomEncrypted, state: roomNotificationRepository.notificationState) + self.state = RoomNotificationSettingsViewStateImpl(roomEncrypted: roomEncrypted, saving: false, notificationState: notificationState) + self.roomNotificationRepository.observeNotificationState { [weak self] state in + guard let self = self else { return } + + self.state.notificationState = Self.mapNotificationStateOnRead(encrypted: roomEncrypted, state: state) } } @@ -57,7 +61,8 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel self.state.notificationState = state case .save: self.state.saving = true - roomNotificationRepository.update(state: state.notificationState) { [weak self] in + let updateState = Self.mapNotificationStateOnUpdate(encrypted: self.state.roomEncrypted, state: state.notificationState) + roomNotificationRepository.update(state: updateState) { [weak self] in guard let self = self else { return } self.state.saving = false self.coordinatorDelegate?.roomNotificationSettingsViewModelDidComplete(self) @@ -69,7 +74,27 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel // MARK: - Private + private static func mapNotificationStateOnRead(encrypted: Bool, state: RoomNotificationState) -> RoomNotificationState { + if encrypted, case .mentionsOnly = state { + // Notifications not supported on encrypted rooms, map mentionsOnly to mute on read + return .mute + } else { + return state + } + } + + private static func mapNotificationStateOnUpdate(encrypted: Bool, state: RoomNotificationState) -> RoomNotificationState { + if encrypted, case .mute = state { + // Notifications not supported on encrypted rooms, map mute to mentions only on update + return .mentionsOnly + } else { + return state + } + } + private func update(viewState: RoomNotificationSettingsViewState) { self.viewDelegate?.roomNotificationSettingsViewModel(self, didUpdateViewState: viewState) } + + } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift index 3677004d4..782a1ad08 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift @@ -20,11 +20,21 @@ import Foundation /// RoomNotificationSettingsViewController view state struct RoomNotificationSettingsViewStateImpl: RoomNotificationSettingsViewState { + let roomEncrypted: Bool var saving: Bool var notificationState: RoomNotificationState + var notificationOptions: [RoomNotificationState] { + if roomEncrypted { + return [.all, .mute] + } else { + return RoomNotificationState.allCases + } + } } protocol RoomNotificationSettingsViewState { var saving: Bool { get } + var roomEncrypted: Bool { get } + var notificationOptions: [RoomNotificationState] { get } var notificationState: RoomNotificationState { get } } From 7392bdbe835e29837a80ddf18e4addf644c52400 Mon Sep 17 00:00:00 2001 From: langleyd Date: Fri, 2 Jul 2021 10:30:44 +0100 Subject: [PATCH 06/72] Fix typo and don't show link to account settings until we have global notification settings. --- Podfile | 4 ++-- Riot/Assets/en.lproj/Vector.strings | 2 +- Riot/Generated/Strings.swift | 6 ++--- ...omNotificationSettingsViewController.swift | 22 +++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Podfile b/Podfile index 8c1ab9284..9bfab4274 100644 --- a/Podfile +++ b/Podfile @@ -11,8 +11,8 @@ use_frameworks! # - `{ {kit spec hash} => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for each repo. Used by Fastfile during CI # # Warning: our internal tooling depends on the name of this variable name, so be sure not to change it -$matrixKitVersion = '= 0.15.0' -# $matrixKitVersion = :local +# $matrixKitVersion = '= 0.15.0' + $matrixKitVersion = :local # $matrixKitVersion = {'develop' => 'develop'} ######################################## diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 7f307756d..f9b75b276 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -781,7 +781,7 @@ Tap the + to start adding people."; "room_notifs_settings_cancel_action" = "Cancel"; "room_notifs_settings_manage_notifications" = "You can manage notifications in %@"; "room_notifs_settings_account_settings" = "Account settings"; -"room_notifs_settings_encryed_room_notice" = "\nPlease note that mentions & keyword notifications are not available in encrypted rooms on mobile."; +"room_notifs_settings_encrypted_room_notice" = "Please note that mentions & keyword notifications are not available in encrypted rooms on mobile."; // Group Details diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 9e4f80e92..e192f4340 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -3038,9 +3038,9 @@ internal enum VectorL10n { internal static var roomNotifsSettingsDoneAction: String { return VectorL10n.tr("Vector", "room_notifs_settings_done_action") } - /// \nPlease note that mentions & keyword notifications are not available in encrypted rooms on mobile. - internal static var roomNotifsSettingsEncryedRoomNotice: String { - return VectorL10n.tr("Vector", "room_notifs_settings_encryed_room_notice") + /// Please note that mentions & keyword notifications are not available in encrypted rooms on mobile. + internal static var roomNotifsSettingsEncryptedRoomNotice: String { + return VectorL10n.tr("Vector", "room_notifs_settings_encrypted_room_notice") } /// You can manage notifications in %@ internal static func roomNotifsSettingsManageNotifications(_ p1: String) -> String { diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index 3948bbc6b..645bf9a3f 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -150,11 +150,6 @@ final class RoomNotificationSettingsViewController: UIViewController { self.viewModel.process(viewAction: .selectNotificationState(setting)) }) }) - - let linkStr = VectorL10n.roomNotifsSettingsAccountSettings - let formatStr = VectorL10n.roomNotifsSettingsManageNotifications(linkStr) - - let formattedStr = String(format: formatStr, arguments: [linkStr]) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineHeightMultiple = 1.16 @@ -163,15 +158,20 @@ final class RoomNotificationSettingsViewController: UIViewController { NSAttributedString.Key.paragraphStyle: paragraphStyle, NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0) ] - let footer0 = NSMutableAttributedString(string: formattedStr, attributes: paragraphAttributes) - let linkRange = (footer0.string as NSString).range(of: linkStr) - footer0.addAttribute(NSAttributedString.Key.link, value: Constants.linkToAccountSettings, range: linkRange) - + + // Don't include link until global settings in place +// let linkStr = VectorL10n.roomNotifsSettingsAccountSettings +// let formatStr = VectorL10n.roomNotifsSettingsManageNotifications(linkStr) +// +// let formattedStr = String(format: formatStr, arguments: [linkStr]) +// let footer0 = NSMutableAttributedString(string: formattedStr, attributes: paragraphAttributes) +// let linkRange = (footer0.string as NSString).range(of: linkStr) +// footer0.addAttribute(NSAttributedString.Key.link, value: Constants.linkToAccountSettings, range: linkRange) + var footer0: NSAttributedString? if viewState.roomEncrypted { - footer0.append(NSAttributedString(string: VectorL10n.roomNotifsSettingsEncryedRoomNotice, attributes: paragraphAttributes)) + footer0 = NSAttributedString(string: VectorL10n.roomNotifsSettingsEncryptedRoomNotice, attributes: paragraphAttributes) } let section0 = Section(header: nil, rows: rows, footer: footer0) - sections = [ section0 ] From ffa6b73945be238b44c34365ab4ae97b03e2df16 Mon Sep 17 00:00:00 2001 From: langleyd Date: Fri, 2 Jul 2021 10:39:27 +0100 Subject: [PATCH 07/72] Fix naming of Repository -> Service, Impl -> Type --- .../RoomNotifcationsRepository.swift | 4 ++-- .../RoomNotificationSettingsCoordinator.swift | 2 +- .../RoomNotificationSettingsViewController.swift | 6 +++--- .../RoomNotificationSettingsViewModel.swift | 10 +++++----- .../RoomNotificationSettingsViewModelType.swift | 2 +- ...ift => RoomNotificationSettingsViewStateType.swift} | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) rename Riot/Modules/Room/NotificationSettings/{RoomNotificationSettingsViewState.swift => RoomNotificationSettingsViewStateType.swift} (90%) diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift index de7571668..615a151cd 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift @@ -22,7 +22,7 @@ enum RoomNotificationState: CaseIterable { case mute } -protocol RoomNotificationRepository { +protocol RoomNotificationSettingsServiceType { typealias Completion = () -> Void typealias NotificationSettingCallback = (RoomNotificationState) -> Void @@ -31,7 +31,7 @@ protocol RoomNotificationRepository { var notificationState: RoomNotificationState { get } } -final class RoomNotificationRepositoryImpl: RoomNotificationRepository { +final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType { // MARK: - Properties diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift index 41c9d6c17..a377dd2b0 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift @@ -37,7 +37,7 @@ final class RoomNotificationSettingsCoordinator: RoomNotificationSettingsCoordin // MARK: - Setup init(room: MXRoom) { - let repository = RoomNotificationRepositoryImpl(room: room) + let repository = RoomNotificationSettingsService(room: room) let roomNotificationSettingsViewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: repository, roomEncrypted: room.summary.isEncrypted) let roomNotificationSettingsViewController = RoomNotificationSettingsViewController.instantiate(with: roomNotificationSettingsViewModel) self.roomNotificationSettingsViewModel = roomNotificationSettingsViewModel diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index 645bf9a3f..cf2bb35a0 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -60,7 +60,7 @@ final class RoomNotificationSettingsViewController: UIViewController { } } - private var viewState: RoomNotificationSettingsViewState! + private var viewState: RoomNotificationSettingsViewStateType! // MARK: - Setup @@ -129,7 +129,7 @@ final class RoomNotificationSettingsViewController: UIViewController { navigationItem.rightBarButtonItem = doneBarButtonItem } - private func render(viewState: RoomNotificationSettingsViewState) { + private func render(viewState: RoomNotificationSettingsViewStateType) { if viewState.saving { activityPresenter.presentActivityIndicator(on: view, animated: true) @@ -261,7 +261,7 @@ extension RoomNotificationSettingsViewController: UITableViewDelegate { // MARK: - RoomNotificationSettingsViewModelViewDelegate extension RoomNotificationSettingsViewController: RoomNotificationSettingsViewModelViewDelegate { - func roomNotificationSettingsViewModel(_ viewModel: RoomNotificationSettingsViewModelType, didUpdateViewState viewSate: RoomNotificationSettingsViewState) { + func roomNotificationSettingsViewModel(_ viewModel: RoomNotificationSettingsViewModelType, didUpdateViewState viewSate: RoomNotificationSettingsViewStateType) { render(viewState: viewSate) } } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift index 00e90dbd0..961770b33 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift @@ -25,8 +25,8 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel // MARK: Private - private let roomNotificationRepository: RoomNotificationRepository - private var state: RoomNotificationSettingsViewStateImpl { + private let roomNotificationRepository: RoomNotificationSettingsServiceType + private var state: RoomNotificationSettingsViewState { willSet { update(viewState: newValue) } @@ -39,11 +39,11 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel // MARK: - Setup - init(roomNotificationRepository: RoomNotificationRepository, roomEncrypted: Bool) { + init(roomNotificationRepository: RoomNotificationSettingsServiceType, roomEncrypted: Bool) { self.roomNotificationRepository = roomNotificationRepository let notificationState = Self.mapNotificationStateOnRead(encrypted: roomEncrypted, state: roomNotificationRepository.notificationState) - self.state = RoomNotificationSettingsViewStateImpl(roomEncrypted: roomEncrypted, saving: false, notificationState: notificationState) + self.state = RoomNotificationSettingsViewState(roomEncrypted: roomEncrypted, saving: false, notificationState: notificationState) self.roomNotificationRepository.observeNotificationState { [weak self] state in guard let self = self else { return } @@ -92,7 +92,7 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel } } - private func update(viewState: RoomNotificationSettingsViewState) { + private func update(viewState: RoomNotificationSettingsViewStateType) { self.viewDelegate?.roomNotificationSettingsViewModel(self, didUpdateViewState: viewState) } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift index 8ec944ade..d6f470e16 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift @@ -19,7 +19,7 @@ import Foundation protocol RoomNotificationSettingsViewModelViewDelegate: AnyObject { - func roomNotificationSettingsViewModel(_ viewModel: RoomNotificationSettingsViewModelType, didUpdateViewState viewSate: RoomNotificationSettingsViewState) + func roomNotificationSettingsViewModel(_ viewModel: RoomNotificationSettingsViewModelType, didUpdateViewState viewSate: RoomNotificationSettingsViewStateType) } protocol RoomNotificationSettingsViewModelCoordinatorDelegate: AnyObject { diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift similarity index 90% rename from Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift rename to Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift index 782a1ad08..01bc56261 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewState.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift @@ -19,7 +19,7 @@ import Foundation /// RoomNotificationSettingsViewController view state -struct RoomNotificationSettingsViewStateImpl: RoomNotificationSettingsViewState { +struct RoomNotificationSettingsViewState: RoomNotificationSettingsViewStateType { let roomEncrypted: Bool var saving: Bool var notificationState: RoomNotificationState @@ -32,7 +32,7 @@ struct RoomNotificationSettingsViewStateImpl: RoomNotificationSettingsViewState } } -protocol RoomNotificationSettingsViewState { +protocol RoomNotificationSettingsViewStateType { var saving: Bool { get } var roomEncrypted: Bool { get } var notificationOptions: [RoomNotificationState] { get } From ec09559afbb957c9e9592e5082c2976743d8d96e Mon Sep 17 00:00:00 2001 From: langleyd Date: Fri, 2 Jul 2021 10:42:30 +0100 Subject: [PATCH 08/72] Remove Podfile change --- Podfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Podfile b/Podfile index 9bfab4274..8079b3e49 100644 --- a/Podfile +++ b/Podfile @@ -11,8 +11,8 @@ use_frameworks! # - `{ {kit spec hash} => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for each repo. Used by Fastfile during CI # # Warning: our internal tooling depends on the name of this variable name, so be sure not to change it -# $matrixKitVersion = '= 0.15.0' - $matrixKitVersion = :local +$matrixKitVersion = '= 0.15.0' +# $matrixKitVersion = :local # $matrixKitVersion = {'develop' => 'develop'} ######################################## @@ -101,7 +101,7 @@ post_install do |installer| # Plus the app does not enable it config.build_settings['ENABLE_BITCODE'] = 'NO' - # Make fastlane(xcodebuild) happy by preventing it from building for arm64 simulator + # Make fastlane(xcodebuild) happy by preventing it from building for arm64 simulator config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" # Force ReadMoreTextView to use Swift 5.2 version (as there is no code changes to perform) @@ -109,7 +109,7 @@ post_install do |installer| config.build_settings['SWIFT_VERSION'] = '5.2' end - # Stop Xcode 12 complaining about old IPHONEOS_DEPLOYMENT_TARGET from pods + # Stop Xcode 12 complaining about old IPHONEOS_DEPLOYMENT_TARGET from pods config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' end end From 4562c6dbc14a48ca3da315bc29b2cdc960d6e9b5 Mon Sep 17 00:00:00 2001 From: langleyd Date: Fri, 2 Jul 2021 10:48:12 +0100 Subject: [PATCH 09/72] Remove Podfile change --- Podfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Podfile b/Podfile index 8079b3e49..8c1ab9284 100644 --- a/Podfile +++ b/Podfile @@ -101,7 +101,7 @@ post_install do |installer| # Plus the app does not enable it config.build_settings['ENABLE_BITCODE'] = 'NO' - # Make fastlane(xcodebuild) happy by preventing it from building for arm64 simulator + # Make fastlane(xcodebuild) happy by preventing it from building for arm64 simulator config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" # Force ReadMoreTextView to use Swift 5.2 version (as there is no code changes to perform) @@ -109,7 +109,7 @@ post_install do |installer| config.build_settings['SWIFT_VERSION'] = '5.2' end - # Stop Xcode 12 complaining about old IPHONEOS_DEPLOYMENT_TARGET from pods + # Stop Xcode 12 complaining about old IPHONEOS_DEPLOYMENT_TARGET from pods config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET' end end From 45cfcf3cc3170dc4a8178e565e465602f9f7199d Mon Sep 17 00:00:00 2001 From: langleyd Date: Fri, 2 Jul 2021 16:16:54 +0100 Subject: [PATCH 10/72] Update theming and footer --- .../RoomNotificationSettingsFooter.swift | 61 +++++++++ .../RoomNotificationSettingsFooter.xib | 39 ++++++ ...omNotificationSettingsViewController.swift | 116 ++++-------------- .../RoomNotificationsSettingsCell.swift | 61 +++++++++ 4 files changed, 186 insertions(+), 91 deletions(-) create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.xib create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift new file mode 100644 index 000000000..4ccf9a124 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift @@ -0,0 +1,61 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import UIKit +import Reusable + +class RoomNotificationSettingsFooter: UITableViewHeaderFooterView { + + struct State { + let showEncryptedNotice: Bool + let showAccountLink: Bool + } + + @IBOutlet weak var label: UILabel! + + func update(footerState: State) { + +// let paragraphStyle = NSMutableParagraphStyle() +// paragraphStyle.lineHeightMultiple = 1.16 +// let paragraphAttributes: [NSAttributedString.Key: Any] = [ +// NSAttributedString.Key.kern: -0.08, +// NSAttributedString.Key.paragraphStyle: paragraphStyle, +// NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0) +// ] + + // Don't include link until global settings in place +// let linkStr = VectorL10n.roomNotifsSettingsAccountSettings +// let formatStr = VectorL10n.roomNotifsSettingsManageNotifications(linkStr) +// +// let formattedStr = String(format: formatStr, arguments: [linkStr]) +// let footer0 = NSMutableAttributedString(string: formattedStr, attributes: paragraphAttributes) +// let linkRange = (footer0.string as NSString).range(of: linkStr) +// footer0.addAttribute(NSAttributedString.Key.link, value: Constants.linkToAccountSettings, range: linkRange) + if footerState.showEncryptedNotice { + label.text = VectorL10n.roomNotifsSettingsEncryptedRoomNotice + } + } +} + + +extension RoomNotificationSettingsFooter: NibReusable {} +extension RoomNotificationSettingsFooter: Themable { + + func update(theme: Theme) { + contentView.backgroundColor = theme.headerBackgroundColor + label.textColor = theme.headerTextSecondaryColor + } +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.xib b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.xib new file mode 100644 index 000000000..48895dca9 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.xib @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index cf2bb35a0..31f441115 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -36,22 +36,14 @@ final class RoomNotificationSettingsViewController: UIViewController { private var errorPresenter: MXKErrorPresentation! private var activityPresenter: ActivityIndicatorPresenter! - private enum RowType { - case plain - } - private struct Row { - var type: RowType - var setting: RoomNotificationState - var text: String? - var accessoryType: UITableViewCell.AccessoryType = .none + var cellState: RoomNotificationSettingsCell.State var action: (() -> Void)? } private struct Section { - var header: String? var rows: [Row] - var footer: NSAttributedString? + var footerState: RoomNotificationSettingsFooter.State } private var sections: [Section] = [] { @@ -104,6 +96,7 @@ final class RoomNotificationSettingsViewController: UIViewController { if let navigationBar = navigationController?.navigationBar { theme.applyStyle(onNavigationBar: navigationBar) } + mainTableView.reloadData() } private func registerThemeServiceDidChangeThemeNotification() { @@ -127,6 +120,10 @@ final class RoomNotificationSettingsViewController: UIViewController { navigationItem.leftBarButtonItem = cancelBarButtonItem } navigationItem.rightBarButtonItem = doneBarButtonItem + mainTableView.register(cellType: RoomNotificationSettingsCell.self) + mainTableView.register(headerFooterViewType: RoomNotificationSettingsFooter.self) + mainTableView.sectionFooterHeight = UITableView.automaticDimension + mainTableView.estimatedSectionFooterHeight = 50 } private func render(viewState: RoomNotificationSettingsViewStateType) { @@ -142,36 +139,14 @@ final class RoomNotificationSettingsViewController: UIViewController { private func updateSections() { let rows = viewState.notificationOptions.map({ (setting) -> Row in - return Row(type: .plain, - setting: setting, - text: setting.title, - accessoryType: viewState.notificationState == setting ? .checkmark : .none, + let cellState = RoomNotificationSettingsCell.State(notificicationState: setting, selected: viewState.notificationState == setting) + return Row(cellState: cellState, action: { self.viewModel.process(viewAction: .selectNotificationState(setting)) }) }) - - let paragraphStyle = NSMutableParagraphStyle() - paragraphStyle.lineHeightMultiple = 1.16 - let paragraphAttributes: [NSAttributedString.Key: Any] = [ - NSAttributedString.Key.kern: -0.08, - NSAttributedString.Key.paragraphStyle: paragraphStyle, - NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0) - ] - - // Don't include link until global settings in place -// let linkStr = VectorL10n.roomNotifsSettingsAccountSettings -// let formatStr = VectorL10n.roomNotifsSettingsManageNotifications(linkStr) -// -// let formattedStr = String(format: formatStr, arguments: [linkStr]) -// let footer0 = NSMutableAttributedString(string: formattedStr, attributes: paragraphAttributes) -// let linkRange = (footer0.string as NSString).range(of: linkStr) -// footer0.addAttribute(NSAttributedString.Key.link, value: Constants.linkToAccountSettings, range: linkRange) - var footer0: NSAttributedString? - if viewState.roomEncrypted { - footer0 = NSAttributedString(string: VectorL10n.roomNotifsSettingsEncryptedRoomNotice, attributes: paragraphAttributes) - } - let section0 = Section(header: nil, rows: rows, footer: footer0) + let footerState = RoomNotificationSettingsFooter.State(showEncryptedNotice: viewState.roomEncrypted, showAccountLink: false) + let section0 = Section(rows: rows, footerState: footerState) sections = [ section0 ] @@ -191,29 +166,15 @@ extension RoomNotificationSettingsViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let row = sections[indexPath.section].rows[indexPath.row] + let cell: RoomNotificationSettingsCell = tableView.dequeueReusableCell(for: indexPath) + cell.update(state: row.cellState) + cell.update(theme: theme) + return cell + } + + func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { - switch row.type { - case .plain: - var cell: UITableViewCell! = tableView.dequeueReusableCell(withIdentifier: Constants.plainStyleCellReuseIdentifier) - if cell == nil { - cell = UITableViewCell(style: .value1, reuseIdentifier: Constants.plainStyleCellReuseIdentifier) - } - cell.textLabel?.font = .systemFont(ofSize: 17) - cell.detailTextLabel?.font = .systemFont(ofSize: 16) - cell.textLabel?.text = row.text - if row.accessoryType == .checkmark { - cell.accessoryView = UIImageView(image: Asset.Images.checkmark.image) - } else { - cell.accessoryView = nil - cell.accessoryType = row.accessoryType - } - cell.textLabel?.textColor = theme.textPrimaryColor - cell.detailTextLabel?.textColor = theme.textSecondaryColor - cell.backgroundColor = theme.backgroundColor - cell.contentView.backgroundColor = .clear - cell.tintColor = theme.tintColor - return cell - } + return UITableView.automaticDimension } } @@ -227,28 +188,14 @@ extension RoomNotificationSettingsViewController: UITableViewDelegate { cell.selectedBackgroundView?.backgroundColor = theme.selectedBackgroundColor } - func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - return sections[section].header + func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { + guard let footerView: RoomNotificationSettingsFooter = tableView.dequeueReusableHeaderFooterView() else { return nil } + let footerState = sections[section].footerState + footerView.update(footerState: footerState) + footerView.update(theme: theme) + return footerView } - func tableView(_ tableView: UITableView, titleForFooterInSection section: Int) -> String? { - return sections[section].footer?.string - } - -// func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { -// if sections[section].footer == nil { -// return nil -// } -// -// let view = tableView.dequeueReusableHeaderFooterView(RiotTableViewHeaderFooterView.self) -// -// view?.textView.attributedText = sections[section].footer -// view?.update(theme: theme) -// view?.delegate = self -// -// return view -// } - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { tableView.deselectRow(at: indexPath, animated: true) @@ -265,16 +212,3 @@ extension RoomNotificationSettingsViewController: RoomNotificationSettingsViewMo render(viewState: viewSate) } } - -extension RoomNotificationState { - var title: String { - switch self { - case .all: - return VectorL10n.roomNotifsSettingsAllMessages - case .mentionsOnly: - return VectorL10n.roomNotifsSettingsMentionsAndKeywords - case .mute: - return VectorL10n.roomNotifsSettingsNone - } - } -} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift new file mode 100644 index 000000000..831c1ba73 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift @@ -0,0 +1,61 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +import UIKit +import Reusable + +class RoomNotificationSettingsCell: UITableViewCell { + + struct State { + let notificicationState: RoomNotificationState + let selected: Bool + } + + func update(state: State) { + textLabel?.font = .systemFont(ofSize: 17) + detailTextLabel?.font = .systemFont(ofSize: 16) + textLabel?.text = state.notificicationState.title + if state.selected { + accessoryView = UIImageView(image: Asset.Images.checkmark.image) + } else { + accessoryView = nil + } + } +} + +extension RoomNotificationSettingsCell: Reusable {} + +extension RoomNotificationSettingsCell: Themable { + func update(theme: Theme) { + textLabel?.textColor = theme.textPrimaryColor + detailTextLabel?.textColor = theme.textSecondaryColor + backgroundColor = theme.backgroundColor + contentView.backgroundColor = .clear + tintColor = theme.tintColor + } +} + +fileprivate extension RoomNotificationState { + var title: String { + switch self { + case .all: + return VectorL10n.roomNotifsSettingsAllMessages + case .mentionsOnly: + return VectorL10n.roomNotifsSettingsMentionsAndKeywords + case .mute: + return VectorL10n.roomNotifsSettingsNone + } + } +} From 6575447f5181de4c56f637bd3930148ba8faba87 Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 2 Jul 2021 16:46:27 +0100 Subject: [PATCH 11/72] Fix documentation warnings. --- Riot/Managers/Widgets/WidgetManager.h | 2 +- Riot/Modules/Application/LegacyAppDelegate.h | 4 ++-- .../Common/SegmentedViewController/SegmentedViewController.m | 2 +- .../BubbleCells/Encryption/RoomEncryptedDataBubbleCell.h | 2 +- Riot/Modules/TabBar/MasterTabBarController.h | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Riot/Managers/Widgets/WidgetManager.h b/Riot/Managers/Widgets/WidgetManager.h index 09c2b2588..f5279a216 100644 --- a/Riot/Managers/Widgets/WidgetManager.h +++ b/Riot/Managers/Widgets/WidgetManager.h @@ -183,7 +183,7 @@ FOUNDATION_EXPORT NSString *const WidgetManagerErrorOpenIdTokenKey; /** Store the integration manager configuration for a user. - @param the integration manager configuration. + @param config the integration manager configuration. @param userId the user id. */ - (void)setConfig:(WidgetManagerConfig*)config forUser:(NSString*)userId; diff --git a/Riot/Modules/Application/LegacyAppDelegate.h b/Riot/Modules/Application/LegacyAppDelegate.h index 78269f348..1b06d8cbe 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.h +++ b/Riot/Modules/Application/LegacyAppDelegate.h @@ -173,7 +173,7 @@ UINavigationControllerDelegate Log out all the accounts without confirmation. Show the authentication screen on successful logout. - @param sendLogoutRequest Indicate whether send logout request to homeserver. + @param sendLogoutServerRequest Indicate whether send logout request to homeserver. @param completion the block to execute at the end of the operation. */ - (void)logoutSendingRequestServer:(BOOL)sendLogoutServerRequest @@ -183,7 +183,7 @@ UINavigationControllerDelegate Present incoming key verification request to accept. @param incomingKeyVerificationRequest The incoming key verification request. - @param The matrix session. + @param session The matrix session. @return Indicate NO if the key verification screen could not be presented. */ - (BOOL)presentIncomingKeyVerificationRequest:(MXKeyVerificationRequest*)incomingKeyVerificationRequest diff --git a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m index a4e4151f7..8480205af 100644 --- a/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m +++ b/Riot/Modules/Common/SegmentedViewController/SegmentedViewController.m @@ -74,7 +74,7 @@ /** init the segmentedViewController with a list of UIViewControllers. @param titles the section tiles - @param viewControllers the list of viewControllers to display. + @param someViewControllers the list of viewControllers to display. @param defaultSelected index of the default selected UIViewController in the list. */ - (void)initWithTitles:(NSArray*)titles viewControllers:(NSArray*)someViewControllers defaultSelected:(NSUInteger)defaultSelected diff --git a/Riot/Modules/Room/Views/BubbleCells/Encryption/RoomEncryptedDataBubbleCell.h b/Riot/Modules/Room/Views/BubbleCells/Encryption/RoomEncryptedDataBubbleCell.h index a97402465..31d5ccaa9 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Encryption/RoomEncryptedDataBubbleCell.h +++ b/Riot/Modules/Room/Views/BubbleCells/Encryption/RoomEncryptedDataBubbleCell.h @@ -31,7 +31,7 @@ extern NSString *const kRoomEncryptedDataBubbleCellTapOnEncryptionIcon; /** Return the icon displayed in front of an event in an encrypted room if needed. - @param event the bubble component. + @param bubbleComponent the bubble component. */ + (UIImage*)encryptionIconForBubbleComponent:(MXKRoomBubbleComponent *)bubbleComponent; diff --git a/Riot/Modules/TabBar/MasterTabBarController.h b/Riot/Modules/TabBar/MasterTabBarController.h index 6ef661948..1d5f41a12 100644 --- a/Riot/Modules/TabBar/MasterTabBarController.h +++ b/Riot/Modules/TabBar/MasterTabBarController.h @@ -90,7 +90,7 @@ @param roomId the room identifier. @param eventId if not nil, the room will be opened on this event. - @param mxSession the matrix session in which the room should be available. + @param matrixSession the matrix session in which the room should be available. @param completion the block to execute at the end of the operation. */ - (void)selectRoomWithId:(NSString*)roomId andEventId:(NSString*)eventId inMatrixSession:(MXSession*)matrixSession completion:(void (^)(void))completion; @@ -113,7 +113,7 @@ Open a GroupDetailsViewController to display the information of the provided group. @param group - @param mxSession the matrix session in which the group should be available. + @param matrixSession the matrix session in which the group should be available. */ - (void)selectGroup:(MXGroup*)group inMatrixSession:(MXSession*)matrixSession; From 41c51f0f50a3bd7caa943ef7fc1e202a71bc9a96 Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 2 Jul 2021 17:13:45 +0100 Subject: [PATCH 12/72] Fix SwiftLint warnings. --- Riot/Modules/Application/AppCoordinator.swift | 11 ++++++++--- .../RoomInfoList/RoomInfoListViewController.swift | 3 +-- .../SettingsIdentityServerViewModel.swift | 3 +-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Riot/Modules/Application/AppCoordinator.swift b/Riot/Modules/Application/AppCoordinator.swift index 4469fbbfa..8a1949f75 100755 --- a/Riot/Modules/Application/AppCoordinator.swift +++ b/Riot/Modules/Application/AppCoordinator.swift @@ -21,8 +21,12 @@ import Intents import FLEX #endif -/// The AppCoordinator is responsible of screen navigation and data injection at root application level. It decides if authentication or home screen should be shown and inject data needed for these flows, it changes the navigation stack on deep link, displays global warning. -/// This class should avoid to contain too many data management code not related to screen navigation logic. For example `MXSession` or push notification management should be handled in dedicated classes and report only navigation changes to the AppCoordinator. +/// The AppCoordinator is responsible of screen navigation and data injection at root application level. It decides +/// if authentication or home screen should be shown and inject data needed for these flows, it changes the navigation +/// stack on deep link, displays global warning. +/// This class should avoid to contain too many data management code not related to screen navigation logic. For example +/// `MXSession` or push notification management should be handled in dedicated classes and report only navigation +/// changes to the AppCoordinator. final class AppCoordinator: NSObject, AppCoordinatorType { // MARK: - Constants @@ -83,7 +87,8 @@ final class AppCoordinator: NSObject, AppCoordinatorType { } func open(url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool { - // NOTE: As said in the Apple documentation be careful on security issues with Custom Scheme URL (see https://developer.apple.com/documentation/xcode/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app) + // NOTE: As said in the Apple documentation be careful on security issues with Custom Scheme URL: + // https://developer.apple.com/documentation/xcode/allowing_apps_and_websites_to_link_to_your_content/defining_a_custom_url_scheme_for_your_app do { let deepLinkOption = try self.customSchemeURLParser.parse(url: url, options: options) diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift index bfc3396bf..02ea3ec3c 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewController.swift @@ -165,8 +165,7 @@ final class RoomInfoListViewController: UIViewController { } var rows = [rowSettings] - if (RiotSettings.shared.roomInfoScreenShowIntegrations) - { + if RiotSettings.shared.roomInfoScreenShowIntegrations { rows.append(rowIntegrations) } rows.append(rowMembers) diff --git a/Riot/Modules/Settings/IdentityServer/SettingsIdentityServerViewModel.swift b/Riot/Modules/Settings/IdentityServer/SettingsIdentityServerViewModel.swift index 0c80415fb..205d7c174 100644 --- a/Riot/Modules/Settings/IdentityServer/SettingsIdentityServerViewModel.swift +++ b/Riot/Modules/Settings/IdentityServer/SettingsIdentityServerViewModel.swift @@ -155,8 +155,7 @@ final class SettingsIdentityServerViewModel: SettingsIdentityServerViewModelType let viewStateUpdate: (SettingsIdentityServerViewState) -> Void = { (viewState) in - // Convert states for .addActionAlert and .disconnectActionAlert to - //.changeActionAlert + // Convert states for .addActionAlert and .disconnectActionAlert to .changeActionAlert var changeViewState = viewState switch viewState { case .alert(let alert, let onContinue): From 0ae203936ea9798d749f814b422a07ab24f5edbc Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 2 Jul 2021 17:38:12 +0100 Subject: [PATCH 13/72] Use different title for scan button for self verification Because it's not 'their' device, it's your own device. --- Riot/Assets/en.lproj/Vector.strings | 1 + Riot/Generated/Strings.swift | 4 ++++ .../KeyVerificationVerifyByScanningViewController.swift | 7 ++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 234022cf2..a0929d888 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -1375,6 +1375,7 @@ Tap the + to start adding people."; "key_verification_verify_qr_code_information_other_device" = "Scan the code below to verify:"; "key_verification_verify_qr_code_emoji_information" = "Verify by comparing unique emoji."; "key_verification_verify_qr_code_scan_code_action" = "Scan their code"; +"key_verification_verify_qr_code_scan_code_other_device_action" = "Scan with this device"; "key_verification_verify_qr_code_cannot_scan_action" = "Can't scan?"; "key_verification_verify_qr_code_start_emoji_action" = "Verify by emoji"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index ba05c0233..34091e1d9 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -2014,6 +2014,10 @@ internal enum VectorL10n { internal static var keyVerificationVerifyQrCodeScanCodeAction: String { return VectorL10n.tr("Vector", "key_verification_verify_qr_code_scan_code_action") } + /// Scan with this device + internal static var keyVerificationVerifyQrCodeScanCodeOtherDeviceAction: String { + return VectorL10n.tr("Vector", "key_verification_verify_qr_code_scan_code_other_device_action") + } /// QR code has been successfully validated. internal static var keyVerificationVerifyQrCodeScanOtherCodeSuccessMessage: String { return VectorL10n.tr("Vector", "key_verification_verify_qr_code_scan_other_code_success_message") diff --git a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift index fc01906da..cb8bc27f6 100644 --- a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift +++ b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift @@ -143,7 +143,9 @@ final class KeyVerificationVerifyByScanningViewController: UIViewController { self.titleLabel.text = VectorL10n.keyVerificationVerifyQrCodeTitle self.informationLabel.text = VectorL10n.keyVerificationVerifyQrCodeInformation - self.scanCodeButton.setTitle(VectorL10n.keyVerificationVerifyQrCodeScanCodeAction, for: .normal) + // Hide until we have the type of the verification request + self.scanCodeButton.isHidden = true + self.cannotScanButton.setTitle(VectorL10n.keyVerificationVerifyQrCodeCannotScanAction, for: .normal) } @@ -195,10 +197,13 @@ final class KeyVerificationVerifyByScanningViewController: UIViewController { switch viewData.verificationKind { case .user: informationText = VectorL10n.keyVerificationVerifyQrCodeInformation + self.scanCodeButton.setTitle(VectorL10n.keyVerificationVerifyQrCodeScanCodeAction, for: .normal) default: informationText = VectorL10n.keyVerificationVerifyQrCodeInformationOtherDevice + self.scanCodeButton.setTitle(VectorL10n.keyVerificationVerifyQrCodeScanCodeOtherDeviceAction, for: .normal) } + self.scanCodeButton.isHidden = false self.informationLabel.text = informationText } } From 16453ae2b07b2d59f8fd1c8933f4a0aebb9359b1 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 2 Jul 2021 17:41:40 +0100 Subject: [PATCH 14/72] changelog --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2e72d9c8e..42179b701 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,7 +8,7 @@ Changes to be released in next version * 🐛 Bugfix - * + * Use different title for scan button for self verification (#4525) ⚠️ API Changes * From 6a48bacd36d3d415460e82dba1287e4cd37fda41 Mon Sep 17 00:00:00 2001 From: langleyd Date: Fri, 2 Jul 2021 20:19:46 +0100 Subject: [PATCH 15/72] Add entry points at long press on home view and slide on recents. --- .../Contents.json | 23 ++++ .../room_action_notification_muted.png | Bin 0 -> 508 bytes .../room_action_notification_muted@2x.png | Bin 0 -> 846 bytes .../room_action_notification_muted@3x.png | Bin 0 -> 1209 bytes Riot/Generated/Images.swift | 1 + .../Common/Recents/RecentsViewController.h | 4 +- .../Common/Recents/RecentsViewController.m | 60 +++++------ Riot/Modules/Home/HomeViewController.m | 6 +- ...ry.swift => RoomNotifcationsService.swift} | 0 ...mNotificationSettingsBridgePresenter.swift | 100 ++++++++++++++++++ ...omNotificationSettingsViewController.swift | 1 - 11 files changed, 156 insertions(+), 39 deletions(-) create mode 100644 Riot/Assets/Images.xcassets/Home/RoomContextualMenu/room_action_notification_muted.imageset/Contents.json create mode 100644 Riot/Assets/Images.xcassets/Home/RoomContextualMenu/room_action_notification_muted.imageset/room_action_notification_muted.png create mode 100644 Riot/Assets/Images.xcassets/Home/RoomContextualMenu/room_action_notification_muted.imageset/room_action_notification_muted@2x.png create mode 100644 Riot/Assets/Images.xcassets/Home/RoomContextualMenu/room_action_notification_muted.imageset/room_action_notification_muted@3x.png rename Riot/Modules/Room/NotificationSettings/{RoomNotifcationsRepository.swift => RoomNotifcationsService.swift} (100%) create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsBridgePresenter.swift diff --git a/Riot/Assets/Images.xcassets/Home/RoomContextualMenu/room_action_notification_muted.imageset/Contents.json b/Riot/Assets/Images.xcassets/Home/RoomContextualMenu/room_action_notification_muted.imageset/Contents.json new file mode 100644 index 000000000..f60c4497c --- /dev/null +++ b/Riot/Assets/Images.xcassets/Home/RoomContextualMenu/room_action_notification_muted.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "room_action_notification_muted.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_action_notification_muted@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_action_notification_muted@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Riot/Assets/Images.xcassets/Home/RoomContextualMenu/room_action_notification_muted.imageset/room_action_notification_muted.png b/Riot/Assets/Images.xcassets/Home/RoomContextualMenu/room_action_notification_muted.imageset/room_action_notification_muted.png new file mode 100644 index 0000000000000000000000000000000000000000..02ca4c76f6fa6f8180d7642294aa227f1ab0e784 GIT binary patch literal 508 zcmVQiAC~9@TO7x*JF|KRdYz za%Pg5B)j*^N$#EmKub!$4to+0cZbTKc&j%Ja%}^px9Cn@SMM*L--oh*ty~R~c@Q~W zbU5%kU{FU;UFj_^fhZOhnENhAB@IMxf%@b^h-P3O9Y4S)VA#o-8vx_I^LFzQiX4b` zGf<3+aMB+q8nRZXYz16EHJZ--dnj@c$?9abyy2V;ZABE|l{jvV!R8=R>;z$*aB|uj zDTTK-00-8$UrXyl7uPRydqjn}rV(g>+IJ&8nFMj5K?7Lsun>Y!-vvN}>uiAhFa2$3GbR}XXZ$KOsW{?iHp(WUg6vs;XLhQiYNyXwu)~Nq= zFk227XBSXG%q+4^ykwj(_y^fim<$NNXxxc&U&r%AoE-Hi5ZXF0t!v&-v>|3%Iq#!o y&XWM*tTon)=^l2?fDdBzmopuSLg@8lL=u=t&Ug#0000r0<-~^NtY&W1i!O98fPB3neb^j`%N`Vv58_}({P9L6 zhZ9@tNDYbq$2+JtYH(h#%>o?>y7M^RV>}E%pM?MzhKDal&;Y(!5WYSb3n4#bYUa!d zyn_qDI8Dwu=;LGKr&rVXBQ$^&ozRNJ>RT*=dXWIm_~1>aJ%k#tvXd?)1ju*c;lUTs zgjH2=D6tT~`7;`pIv?Uy6}09=r#){nCvXip(fv?m1X3<$Gv`#CFl2}%Od^;hbAP*}mB1Y`WUPJOiq2p&|{F(iSjbPqI86Yyk9sh$}L zt>+QtIiO5)i7g8d=D%VKu_Hh@lCUR0IFPU_KvzoBCxviGD=c~ zE~qJyD?sT&zDF51N1acpA(5E_lqnMubDi5nV@_luu=UOp8j;8jA>53BT|iMHo1Mm- z4#?#IAFiK*V;Ez-Y+?CuQci5Spw9lpP6-gY5=I56aZKz4g%$3ej8xKwIub?&CO5Mf z2Xf)sK}ljt7J~w+5@vsmGFF(=b+B+z1@C2n@0O$hH2`Cf51O+B28yL#h9VHhwARCasg;=Uy zLvlcIkSxhkfaflkoTbFh<5wS+WCJ|&j0x=Sh9qg%VeB%3%du`8H#+ddxg{t`jwi5I zN#xf0RU)o`nr?gtha`J{W)UkZz{D&F=*k1yPA_mZl#_Ey(C%UDOuj|8G6>lG^x^Fy zI3PJZnL}W|?n&zKzZi!g3Hu-DOu`*GgkZ4n`=GS}PIk`La*`sf2`Bs1WgrNu)lOa} z7n1T$$N(lLAOHq};wc%JOROXct4Tvj3LAlQyPrp@M5V+%@#-M7)EBob470ZW|o<$mjEKnEE9C{q;6ORym+ z>o$y6sFjMqE~T|{n3vF;nOrchlg2tSV;Afb;W$4_4qMCM7#x;pDoLKbL_AeV%7Tc{C2JxG#@s!8$$9Fqm0qqFt6LKVF<4d-F3k=`@ zJHyhwNs`xkwk~pw1j(j#{-HeHB-MIWdf9~qWoJn7s@#Vpgvvw1DT=>Slxk0_axGnw zrD9fG5W*~IQo5v>nj zB1S=yS3yMRlDrEdLY5SSAR<&r!3ZKkloXU8A~Z?C2_iz06r>;`6iLAfB0`W9v>+mY z$;t5XI(!Qwf-gxUBZ%-bGC5+DEotNg5z3NMb4kS~4i8%A7FLWI;c|&`pF$Co>>p3~ zmP5E)qTHvDAOv*2vP%`$lC+DMoJz@-zd>NQDsEa4bS)==0C5#b$`N!!P6PpCJCc+l zXz!rCgf-rVz~vCOBWY*^Wl=*nmFTXF4**+{lq+adiqtS{NXji@SW8{3kS`S*#V!9< zgu|AAM*>BXeETM&N&7$LSJFawo$|E_MUs5`DWgfd-WbL?k zh`>XVpx2A~AH4{o=Y(*P#z0R}$c3G9hA}u|h@`WdH{*G$q^WO10yu~*(H}XGQ6)d` z$dQEQ=JcCJ_P`Z~kR;B +@interface RecentsViewController () { // Tell whether a recents refresh is pending (suspended during editing mode). BOOL isRefreshPending; @@ -74,6 +74,8 @@ @property (nonatomic, strong) CustomSizedPresentationController *customSizedPresentationController; +@property (nonatomic, strong) RoomNotificationSettingsCoordinatorBridgePresenter *roomNotificationSettingsCoordinatorBridgePresenter; + @end @implementation RecentsViewController @@ -1031,12 +1033,12 @@ UIContextualAction *muteAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:title handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) { - [self muteEditedRoomNotifications:!isMuted]; + [self changeEditedRoomNotificationSettings]; completionHandler(YES); }]; muteAction.backgroundColor = actionBackgroundColor; - UIImage *notificationImage = [UIImage imageNamed:@"room_action_notification"]; + UIImage *notificationImage = isMuted ? [UIImage imageNamed:@"room_action_notification_muted"] : [UIImage imageNamed:@"room_action_notification"]; notificationImage = [notificationImage vc_tintedImageUsingColor:isMuted ? unselectedColor : selectedColor]; muteAction.image = [notificationImage vc_notRenderedImage]; @@ -1298,7 +1300,7 @@ } } -- (void)muteEditedRoomNotifications:(BOOL)mute +- (void)changeEditedRoomNotificationSettings { if (editedRoomId) { @@ -1306,36 +1308,22 @@ MXRoom *room = [self.mainSession roomWithRoomId:editedRoomId]; if (room) { - [self startActivityIndicator]; - - if (mute) - { - [room mentionsOnly:^{ - - [self stopActivityIndicator]; - - // Leave editing mode - [self cancelEditionMode:isRefreshPending]; - - }]; - } - else - { - [room allMessages:^{ - - [self stopActivityIndicator]; - - // Leave editing mode - [self cancelEditionMode:isRefreshPending]; - - }]; - } - } - else - { - // Leave editing mode - [self cancelEditionMode:isRefreshPending]; + // navigate + self.roomNotificationSettingsCoordinatorBridgePresenter = [[RoomNotificationSettingsCoordinatorBridgePresenter alloc] initWithRoom:room]; + self.roomNotificationSettingsCoordinatorBridgePresenter.delegate = self; + [self.roomNotificationSettingsCoordinatorBridgePresenter presentFrom:self animated:YES]; } + [self cancelEditionMode:isRefreshPending]; + } +} + +- (void)openNotificationsSettings +{ + if (self.mainSession) + { + self.createRoomCoordinatorBridgePresenter = [[CreateRoomCoordinatorBridgePresenter alloc] initWithSession:self.mainSession]; + self.createRoomCoordinatorBridgePresenter.delegate = self; + [self.createRoomCoordinatorBridgePresenter presentFrom:self animated:YES]; } } @@ -2219,4 +2207,10 @@ } } +-(void)roomNotificationSettingsCoordinatorBridgePresenterDelegateDidComplete:(RoomNotificationSettingsCoordinatorBridgePresenter *)coordinatorBridgePresenter +{ + [coordinatorBridgePresenter dismissWithAnimated:YES completion:nil]; + self.roomsDirectoryCoordinatorBridgePresenter = nil; +} + @end diff --git a/Riot/Modules/Home/HomeViewController.m b/Riot/Modules/Home/HomeViewController.m index d8d5382fc..3f872cf2d 100644 --- a/Riot/Modules/Home/HomeViewController.m +++ b/Riot/Modules/Home/HomeViewController.m @@ -347,7 +347,8 @@ tableViewCell.notificationsButton.tag = room.isMute || room.isMentionsOnly; [tableViewCell.notificationsButton addTarget:self action:@selector(onNotificationsButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; - tableViewCell.notificationsImageView.image = [UIImage imageNamed:@"room_action_notification"]; + tableViewCell.notificationsImageView.image = tableViewCell.notificationsButton.tag ? [UIImage imageNamed:@"room_action_notification_muted"] : [UIImage imageNamed:@"room_action_notification"]; + tableViewCell.notificationsImageView.tintColor = tableViewCell.notificationsButton.tag ? unselectedColor : selectedColor; // Get the room tag (use only the first one). @@ -663,8 +664,7 @@ MXRoom *room = [self.mainSession roomWithRoomId:editedRoomId]; if (room) { - UIButton *button = (UIButton*)sender; - [self muteEditedRoomNotifications:!button.tag]; + [self changeEditedRoomNotificationSettings]; } } } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsService.swift similarity index 100% rename from Riot/Modules/Room/NotificationSettings/RoomNotifcationsRepository.swift rename to Riot/Modules/Room/NotificationSettings/RoomNotifcationsService.swift diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsBridgePresenter.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsBridgePresenter.swift new file mode 100644 index 000000000..0be2f18a1 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsBridgePresenter.swift @@ -0,0 +1,100 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +import Foundation + +@objc protocol RoomNotificationSettingsCoordinatorBridgePresenterDelegate { + func roomNotificationSettingsCoordinatorBridgePresenterDelegateDidComplete(_ coordinatorBridgePresenter: RoomNotificationSettingsCoordinatorBridgePresenter) +} + +/// RoomNotificationSettingsCoordinatorBridgePresenter enables to start RoomNotificationSettingsCoordinator from a view controller. +/// This bridge is used while waiting for global usage of coordinator pattern. +/// It breaks the Coordinator abstraction and it has been introduced for Objective-C compatibility (mainly for integration in legacy view controllers). +/// Each bridge should be removed once the underlying Coordinator has been integrated by another Coordinator. +@objcMembers +final class RoomNotificationSettingsCoordinatorBridgePresenter: NSObject { + + // MARK: - Properties + + // MARK: Private + + private let room: MXRoom + private var coordinator: RoomNotificationSettingsCoordinator? + + // MARK: Public + + weak var delegate: RoomNotificationSettingsCoordinatorBridgePresenterDelegate? + + // MARK: - Setup + + init(room: MXRoom) { + self.room = room + super.init() + } + + // MARK: - Public + + // NOTE: Default value feature is not compatible with Objective-C. + // func present(from viewController: UIViewController, animated: Bool) { + // self.present(from: viewController, animated: animated) + // } + + func present(from viewController: UIViewController, animated: Bool) { + let roomNotificationSettingsCoordinator = RoomNotificationSettingsCoordinator(room: room) + roomNotificationSettingsCoordinator.delegate = self + let presentable = roomNotificationSettingsCoordinator.toPresentable() + let navigationController = RiotNavigationController(rootViewController: presentable) + navigationController.modalPresentationStyle = .formSheet + presentable.presentationController?.delegate = self + viewController.present(navigationController, animated: animated, completion: nil) + roomNotificationSettingsCoordinator.start() + + self.coordinator = roomNotificationSettingsCoordinator + } + + func dismiss(animated: Bool, completion: (() -> Void)?) { + guard let coordinator = self.coordinator else { + return + } + coordinator.toPresentable().dismiss(animated: animated) { + self.coordinator = nil + + if let completion = completion { + completion() + } + } + } +} + +// MARK: - RoomNotificationSettingsCoordinatorDelegate +extension RoomNotificationSettingsCoordinatorBridgePresenter: RoomNotificationSettingsCoordinatorDelegate { + func roomNotificationSettingsCoordinatorDidCancel(_ coordinator: RoomNotificationSettingsCoordinatorType) { + self.delegate?.roomNotificationSettingsCoordinatorBridgePresenterDelegateDidComplete(self) + } + + func roomNotificationSettingsCoordinatorDidComplete(_ coordinator: RoomNotificationSettingsCoordinatorType) { + self.delegate?.roomNotificationSettingsCoordinatorBridgePresenterDelegateDidComplete(self) + } +} + +// MARK: - UIAdaptivePresentationControllerDelegate + +extension RoomNotificationSettingsCoordinatorBridgePresenter: UIAdaptivePresentationControllerDelegate { + + func roomNotificationSettingsCoordinatorDidComplete(_ presentationController: UIPresentationController) { + self.delegate?.roomNotificationSettingsCoordinatorBridgePresenterDelegateDidComplete(self) + } + +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index 31f441115..7135aaa95 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -22,7 +22,6 @@ final class RoomNotificationSettingsViewController: UIViewController { // MARK: - Properties private enum Constants { - static let plainStyleCellReuseIdentifier = "plain" static let linkToAccountSettings = "linkToAccountSettings" } // MARK: Outlets From 1e5d264288ffe245cb0b0b99826d6462049246e3 Mon Sep 17 00:00:00 2001 From: jelv Date: Fri, 2 Jul 2021 10:52:46 +0000 Subject: [PATCH 16/72] Translated using Weblate (Dutch) Currently translated at 100.0% (1233 of 1233 strings) Translation: Element iOS/Element iOS Translate-URL: https://translate.element.io/projects/riot-ios/riot-ios/nl/ --- Riot/Assets/nl.lproj/Vector.strings | 90 ++++++++++++++--------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/Riot/Assets/nl.lproj/Vector.strings b/Riot/Assets/nl.lproj/Vector.strings index 4b144ba88..7db13f3b6 100644 --- a/Riot/Assets/nl.lproj/Vector.strings +++ b/Riot/Assets/nl.lproj/Vector.strings @@ -611,7 +611,7 @@ "room_does_not_exist" = "%@ bestaat niet"; // Key backup wrong version "e2e_key_backup_wrong_version_title" = "Nieuwe sleutelback-up"; -"e2e_key_backup_wrong_version" = "Er is een nieuwe sleutelback-up voor versleutelde berichten gedetecteerd.\n\nIndien deze niet van u komt, stel dan een nieuw wachtwoord in in de instellingen."; +"e2e_key_backup_wrong_version" = "Er is een nieuwe sleutelback-up voor versleutelde berichten gedetecteerd.\n\nIndien deze niet van u komt, stel dan een nieuw veiligheidswachtwoord in in de instellingen."; "e2e_key_backup_wrong_version_button_settings" = "Instellingen"; "e2e_key_backup_wrong_version_button_wasme" = "Ik was het"; "key_backup_setup_title" = "Sleutelback-up"; @@ -623,10 +623,10 @@ "key_backup_setup_intro_setup_action_without_existing_backup" = "Begin sleutelback-up te gebruiken"; "key_backup_setup_intro_manual_export_info" = "(Geavanceerd)"; "key_backup_setup_intro_manual_export_action" = "Sleutels handmatig exporteren"; -"key_backup_setup_passphrase_title" = "Beveilig uw back-up met een wachtwoord"; -"key_backup_setup_passphrase_info" = "We bewaren een versleutelde kopie van uw sleutels op onze server. Bescherm uw back-up met een wachtwoord om deze veilig te houden.\n\nVoor maximale beveiliging zou dit moeten verschillen van uw accountwachtwoord."; +"key_backup_setup_passphrase_title" = "Beveilig uw back-up met een veiligheidswachtwoord"; +"key_backup_setup_passphrase_info" = "We bewaren een versleutelde kopie van uw sleutels op onze server. Bescherm uw back-up met een veiligheidswachtwoord om deze veilig te houden.\n\nVoor maximale beveiliging zou dit moeten verschillen van uw accountwachtwoord."; "key_backup_setup_passphrase_passphrase_title" = "Invoeren"; -"key_backup_setup_passphrase_passphrase_placeholder" = "Voer wachtwoord in"; +"key_backup_setup_passphrase_passphrase_placeholder" = "Wachtwoord invoeren"; "key_backup_setup_passphrase_passphrase_valid" = "Top!"; "key_backup_setup_passphrase_passphrase_invalid" = "Probeer nog een woord toe te voegen"; "key_backup_setup_passphrase_confirm_passphrase_title" = "Bevestigen"; @@ -634,35 +634,35 @@ "key_backup_setup_passphrase_confirm_passphrase_valid" = "Top!"; "key_backup_setup_passphrase_confirm_passphrase_invalid" = "Wachtwoorden komen niet overeen"; "key_backup_setup_passphrase_set_passphrase_action" = "Wachtwoord instellen"; -"key_backup_setup_passphrase_setup_recovery_key_info" = "Of beveilig uw back-up met een herstelsleutel, en bewaar deze op een veilige plaats."; -"key_backup_setup_passphrase_setup_recovery_key_action" = "(Geavanceerd) Instellen met herstelsleutel"; +"key_backup_setup_passphrase_setup_recovery_key_info" = "Of beveilig uw back-up met een veiligheidssleutel en bewaar deze op een veilige plaats."; +"key_backup_setup_passphrase_setup_recovery_key_action" = "(Geavanceerd) Instellen met veiligheidssleutel"; "key_backup_setup_success_title" = "Klaar!"; // Success from passphrase -"key_backup_setup_success_from_passphrase_info" = "Er wordt een back-up van uw sleutels gemaakt.\n\nUw herstelsleutel is een veiligheidsnet - u kunt deze gebruiken om de toegang tot uw versleutelde berichten te herstellen als u uw wachtwoord zou vergeten.\n\nBewaar uw herstelsleutel op een heel veilig plaats, zoals een wachtwoordbeheerder (of een kluis)."; -"key_backup_setup_success_from_passphrase_save_recovery_key_action" = "Herstelsleutel opslaan"; +"key_backup_setup_success_from_passphrase_info" = "Er wordt een back-up van uw sleutels gemaakt.\n\nUw veiligheidssleutel is een veiligheidsnet - u kunt deze gebruiken om de toegang tot uw versleutelde berichten te herstellen als u uw wachtwoord zou vergeten.\n\nBewaar uw veiligheidssleutel op een heel veilige plaats, zoals een wachtwoordbeheerder (of een kluis)."; +"key_backup_setup_success_from_passphrase_save_recovery_key_action" = "Veiligheidssleutel opslaan"; "key_backup_setup_success_from_passphrase_done_action" = "Klaar"; // Success from recovery key -"key_backup_setup_success_from_recovery_key_info" = "Er wordt een back-up van uw sleutels gemaakt.\n\nMaak een kopie van deze herstelsleutel en bewaar deze op een veilige plaats."; -"key_backup_setup_success_from_recovery_key_recovery_key_title" = "Herstelsleutel"; +"key_backup_setup_success_from_recovery_key_info" = "Er wordt een back-up van uw sleutels gemaakt.\n\nMaak een kopie van deze veiligheidssleutel en bewaar deze op een veilige plaats."; +"key_backup_setup_success_from_recovery_key_recovery_key_title" = "Veiligheidssleutel"; "key_backup_setup_success_from_recovery_key_make_copy_action" = "Maak een kopie"; "key_backup_setup_success_from_recovery_key_made_copy_action" = "Ik heb een kopie gemaakt"; "key_backup_recover_title" = "Versleutelde berichten"; -"key_backup_recover_invalid_passphrase_title" = "Onjuist herstelwachtwoord"; -"key_backup_recover_invalid_passphrase" = "De back-up kon niet ontsleuteld worden met dit wachtwoord: controleer of u het herstelwachtwoord juist hebt ingevoerd."; -"key_backup_recover_invalid_recovery_key_title" = "Herstelsleutel komt niet overeen"; -"key_backup_recover_invalid_recovery_key" = "De back-up kon niet ontsleuteld worden met deze sleutel: controleer of u de juiste herstelsleutel hebt ingevoerd."; -"key_backup_recover_from_passphrase_info" = "Gebruik uw herstelwachtwoord om uw versleutelde berichtgeschiedenis te ontgrendelen"; +"key_backup_recover_invalid_passphrase_title" = "Onjuist veiligheidswachtwoord"; +"key_backup_recover_invalid_passphrase" = "De back-up kon niet ontsleuteld worden met dit wachtwoord: controleer of u het veiligheidswachtwoord juist hebt ingevoerd."; +"key_backup_recover_invalid_recovery_key_title" = "Veiligheidssleutel komt niet overeen"; +"key_backup_recover_invalid_recovery_key" = "De back-up kon niet ontsleuteld worden met deze sleutel: controleer of u de juiste veiligheidssleutel hebt ingevoerd."; +"key_backup_recover_from_passphrase_info" = "Gebruik uw veiligheidswachtwoord om uw versleutelde berichtengeschiedenis te ontgrendelen"; "key_backup_recover_from_passphrase_passphrase_title" = "Invoeren"; -"key_backup_recover_from_passphrase_passphrase_placeholder" = "Voer wachtwoord in"; +"key_backup_recover_from_passphrase_passphrase_placeholder" = "Wachtwoord invoeren"; "key_backup_recover_from_passphrase_recover_action" = "Geschiedenis ontgrendelen"; -"key_backup_recover_from_passphrase_lost_passphrase_action_part1" = "Herstelwachtwoord vergeten? Dan kunt u "; -"key_backup_recover_from_passphrase_lost_passphrase_action_part2" = "uw herstelsleutel gebruiken"; +"key_backup_recover_from_passphrase_lost_passphrase_action_part1" = "Veiligheidswachtwoord vergeten? Dan kunt u "; +"key_backup_recover_from_passphrase_lost_passphrase_action_part2" = "uw veiligheidssleutel gebruiken"; "key_backup_recover_from_passphrase_lost_passphrase_action_part3" = "."; -"key_backup_recover_from_recovery_key_info" = "Gebruik uw herstelsleutel om uw versleutelde berichtgeschiedenis te ontgrendelen"; +"key_backup_recover_from_recovery_key_info" = "Gebruik uw veiligheidssleutel om uw versleutelde berichtengeschiedenis te ontgrendelen"; "key_backup_recover_from_recovery_key_recovery_key_title" = "Invoeren"; -"key_backup_recover_from_recovery_key_recovery_key_placeholder" = "Voer herstelsleutel in"; +"key_backup_recover_from_recovery_key_recovery_key_placeholder" = "Veiligheidssleutel invoeren"; "key_backup_recover_from_recovery_key_recover_action" = "Geschiedenis ontgrendelen"; -"key_backup_recover_from_recovery_key_lost_recovery_key_action" = "Herstelsleutel verloren? U kunt er een nieuwe aanmaken in de instellingen."; +"key_backup_recover_from_recovery_key_lost_recovery_key_action" = "Veiligheidssleutel verloren? U kunt er een nieuwe aanmaken in de instellingen."; "key_backup_recover_success_info" = "Back-up hersteld!"; "key_backup_recover_done_action" = "Klaar"; "key_backup_setup_banner_title" = "Verlies nooit uw versleutelde berichten"; @@ -913,7 +913,7 @@ // MARK: - Favourites "favourites_empty_view_title" = "Favoriete gesprekken en personen"; -"home_empty_view_information" = "De alles-in-één veilige chat app voor teams, vrienden en organisaties. Klik op de onderstaande + knop om gesprekken te starten met personen en groepen."; +"home_empty_view_information" = "De alles-in-één veilige chat-app voor teams, vrienden en organisaties. Druk op de + knop hieronder om personen en gesprekken toe te voegen."; // MARK: - Home @@ -1032,32 +1032,32 @@ "secrets_setup_recovery_key_done_action" = "Klaar"; "secrets_setup_recovery_key_export_action" = "Opslaan"; "secrets_setup_recovery_key_loading" = "Laden…"; -"secrets_setup_recovery_key_information" = "Bewaar uw Herstelsleutel op een veilige plek. Het kan gebruikt worden voor het ontgrendelen van uw versleutelde berichten en data."; -"secrets_recovery_with_key_invalid_recovery_key_message" = "Verifieer dat u de juiste herstelsleutel heeft ingevoerd."; +"secrets_setup_recovery_key_information" = "Bewaar uw veiligheidssleutel op een veilige plek. Deze kan gebruikt worden om uw versleutelde berichten en data te ontsleutelen."; +"secrets_recovery_with_key_invalid_recovery_key_message" = "Verifieer dat u de juiste veiligheidssleutel heeft ingevoerd."; "secrets_recovery_with_key_invalid_recovery_key_title" = "Geen toegang tot geheime opslag"; "secrets_recovery_with_key_recover_action" = "Gebruik sleutel"; -"secrets_recovery_with_key_recovery_key_placeholder" = "Voer de herstelsleutel in"; +"secrets_recovery_with_key_recovery_key_placeholder" = "Veiligheidssleutel invoeren"; "secrets_recovery_with_key_recovery_key_title" = "Invoeren"; -"secrets_recovery_with_key_information_verify_device" = "Gebruik uw herstelsleutel om dit apparaat te verifiëren."; -"secrets_recovery_with_key_information_default" = "Ontvang toegang tot uw versleutelde berichtengeschiedenis en uw kruislings ondertekenen ID voor het verifiëren van andere sessie door het invoeren van uw Herstelsleutel."; +"secrets_recovery_with_key_information_verify_device" = "Gebruik uw veiligheidssleutel om dit apparaat te verifiëren."; +"secrets_recovery_with_key_information_default" = "Ontvang toegang tot uw versleutelde berichtengeschiedenis en kruislings ondertekenen voor het verifiëren van andere sessie door het invoeren van uw veiligheidssleutel."; // Recover with key -"secrets_recovery_with_key_title" = "Herstelsleutel"; -"secrets_recovery_with_passphrase_invalid_passphrase_message" = "Verifieer dat u het juiste Herstelwachtwoord heeft ingevoerd."; +"secrets_recovery_with_key_title" = "Veiligheidssleutel"; +"secrets_recovery_with_passphrase_invalid_passphrase_message" = "Verifieer dat u het juiste veiligheidswachtwoord heeft ingevoerd."; "secrets_recovery_with_passphrase_invalid_passphrase_title" = "Geen toegang tot geheime opslag"; "secrets_recovery_with_passphrase_lost_passphrase_action_part3" = "."; -"secrets_recovery_with_passphrase_lost_passphrase_action_part2" = "uw Herstelsleutel gebruiken"; -"secrets_recovery_with_passphrase_lost_passphrase_action_part1" = "Herstelwachtwoord vergeten? Dan kunt u "; -"secrets_recovery_with_passphrase_recover_action" = "Gebruik Wachtwoord"; -"secrets_recovery_with_passphrase_passphrase_placeholder" = "Voer uw Herstelwachtwoord in"; +"secrets_recovery_with_passphrase_lost_passphrase_action_part2" = "uw veiligheidssleutel gebruiken"; +"secrets_recovery_with_passphrase_lost_passphrase_action_part1" = "Veiligheidswachtwoord vergeten? Dan kunt u "; +"secrets_recovery_with_passphrase_recover_action" = "Gebruik wachtwoord"; +"secrets_recovery_with_passphrase_passphrase_placeholder" = "Voer uw veiligheidswachtwoord in"; "secrets_recovery_with_passphrase_passphrase_title" = "Invoeren"; -"secrets_recovery_with_passphrase_information_verify_device" = "Gebruik uw Herstelwachtwoord om dit apparaat te verifiëren."; -"secrets_recovery_with_passphrase_information_default" = "Ontvang toegang tot uw versleutelde berichtengeschiedenis en uw kruislings ondertekenen ID voor het verifiëren van andere sessies door het invoeren van uw Herstelwachtwoord."; +"secrets_recovery_with_passphrase_information_verify_device" = "Gebruik uw veiligheidswachtwoord om dit apparaat te verifiëren."; +"secrets_recovery_with_passphrase_information_default" = "Ontvang toegang tot uw versleutelde berichtengeschiedenis en kruislings ondertekenen voor het verifiëren van andere sessies door het invoeren van uw veiligheidswachtwoord."; // Recover with passphrase -"secrets_recovery_with_passphrase_title" = "Herstelwachtwoord"; +"secrets_recovery_with_passphrase_title" = "Veiligheidswachtwoord"; "secrets_recovery_reset_action_part_2" = "Alles opnieuw instellen"; // MARK: - Secrets recovery @@ -1067,7 +1067,7 @@ "user_verification_session_details_verify_action_current_user_manually" = "Handmatig middels een tekst"; "user_verification_session_details_verify_action_current_user" = "Interactief Verifiëren"; "user_verification_session_details_additional_information_untrusted_current_user" = "Als u zich niet heeft aangemeld bij deze sessie, is uw account wellicht geschonden."; -"user_verification_session_details_additional_information_untrusted_other_user" = "Totdat deze persoon de sessie vertrouwd zijn berichten gelabeld met een waarschuwing. Een alternatief is handmatig verifiëren."; +"user_verification_session_details_additional_information_untrusted_other_user" = "Totdat deze persoon deze sessie vertrouwd, zijn berichten gelabeld met waarschuwingen. Een andere mogelijkheid is om de persoon handmatig te verifiëren."; "user_verification_session_details_information_untrusted_other_user" = " heeft zich in een nieuwe sessie aangemeld:"; "user_verification_session_details_information_untrusted_current_user" = "Verifieer deze sessie om het als vertrouwd te markeren en het toegang te geven tot versleutelde berichten:"; "user_verification_session_details_information_trusted_other_user_part2" = " verifieer het:"; @@ -1180,8 +1180,8 @@ "key_verification_verify_sas_title_emoji" = "Vergelijk de emoji's"; "device_verification_self_verify_wait_recover_secrets_checking_availability" = "Controleren op andere verificatie mogelijkheden..."; "device_verification_self_verify_wait_recover_secrets_additional_information" = "Wanneer u geen toegang meer heeft tot een bestaande sessie"; -"device_verification_self_verify_wait_recover_secrets_with_passphrase" = "Uw Herstelwachtwoord of -sleutel gebruiken"; -"device_verification_self_verify_wait_recover_secrets_without_passphrase" = "Herstelsleutel gebruiken"; +"device_verification_self_verify_wait_recover_secrets_with_passphrase" = "Uw veiligheidswachtwoord of -sleutel gebruiken"; +"device_verification_self_verify_wait_recover_secrets_without_passphrase" = "Veiligheidssleutel gebruiken"; "device_verification_self_verify_wait_additional_information" = "Dit werkt met Element en andere Matrix-apps die kruislings ondertekenen ondersteunen."; "device_verification_self_verify_wait_information" = "Verifieer deze sessie vanaf een van uw andere sessies, om toegang te krijgen tot de versleutelde berichten.\n\nGebruik de laatste versie van Element op uw andere apparaten:"; "device_verification_self_verify_wait_new_sign_in_title" = "Verifieer deze login"; @@ -1292,11 +1292,11 @@ "room_details_advanced_e2e_encryption_disabled_for_dm" = "Versleuteling is hier niet ingeschakeld."; "room_details_advanced_e2e_encryption_enabled_for_dm" = "Versleuteling is hier ingeschakeld"; "room_details_advanced_room_id_for_dm" = "ID:"; -"room_details_no_local_addresses_for_dm" = "Dit heeft geen lokaaladres"; +"room_details_no_local_addresses_for_dm" = "Geen lokaaladres bekend"; "room_details_access_section_directory_toggle_for_dm" = "Weergeven in publieke groepsgesprekkencatalogus"; "room_details_access_section_anyone_for_dm" = "Iedereen die de koppeling kent, inclusief gasten"; "room_details_access_section_anyone_apart_from_guest_for_dm" = "Iedereen die de koppeling kent, behalve gasten"; -"room_details_access_section_for_dm" = "Wie mag toegang hebben?"; +"room_details_access_section_for_dm" = "Wie heeft toegang?"; "room_details_room_name_for_dm" = "Naam"; "room_details_photo_for_dm" = "Foto"; "room_details_title_for_dm" = "Details"; @@ -1343,17 +1343,17 @@ "security_settings_cryptography" = "CRYPTOGRAFIE"; "security_settings_crosssigning_complete_security" = "Beveiliging afronden"; "security_settings_crosssigning_reset" = "Reset"; -"security_settings_crosssigning_bootstrap" = "Stel in"; -"security_settings_crosssigning_info_ok" = "Cross-signing is klaar voor gebruik."; +"security_settings_crosssigning_bootstrap" = "Instellen"; +"security_settings_crosssigning_info_ok" = "Kruiselings ondertekenen is klaar voor gebruik."; "security_settings_crosssigning_info_trusted" = "Kruislings ondertekenen is ingeschakeld. U kunt andere personen en sessies verifiëren met kruislings ondertekenen, maar u kunt dit nog niet vanaf deze sessie doordat de versleutelingssleutel ontbreekt. Rond de beveiliging van deze sessie af."; "security_settings_crosssigning_info_exists" = "Uw account heeft een kruislings ondertekenen ID, maar is nog niet geverifieerd door deze sessie. Rond de beveiliging van deze sessie af."; "security_settings_crosssigning_info_not_bootstrapped" = "Kruislings ondertekenen is nog niet ingesteld."; "security_settings_crosssigning" = "KRUISLINGS ONDERTEKENEN"; "security_settings_backup" = "BERICHTENBACK-UP"; -"security_settings_secure_backup_delete" = "Verwijder backup"; +"security_settings_secure_backup_delete" = "Back-up verwijderen"; "security_settings_secure_backup_synchronise" = "Synchroniseren"; "security_settings_secure_backup_setup" = "Instellen"; -"security_settings_secure_backup_description" = "Waarborg uw toegang tot uw versleutelde berichten & data door de versleutelingssleutels op te slaan. Uw sleutels zullen worden beveiligd met een unieke beveiligingssleutel."; +"security_settings_secure_backup_description" = "Maak een back-up van uw versleutelingssleutel bij uw account data voor het geval u toegang verliest tot uw sessies. Uw sleutels zullen worden beveiligd met een unieke veiligheidssleutel."; "security_settings_secure_backup" = "VEILIGE BACK-UP"; "security_settings_crypto_sessions_description_2" = "Als u deze inlog niet herkent, verander uw wachtwoord en reset uw Veilige Back-up."; "security_settings_crypto_sessions_loading" = "Sessies laden…"; From 7824de6647bea0b256c1a85c10041b41c244bca1 Mon Sep 17 00:00:00 2001 From: Tim Al Date: Fri, 2 Jul 2021 10:50:26 +0000 Subject: [PATCH 17/72] Translated using Weblate (Dutch) Currently translated at 100.0% (1233 of 1233 strings) Translation: Element iOS/Element iOS Translate-URL: https://translate.element.io/projects/riot-ios/riot-ios/nl/ --- Riot/Assets/nl.lproj/Vector.strings | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Riot/Assets/nl.lproj/Vector.strings b/Riot/Assets/nl.lproj/Vector.strings index 7db13f3b6..1b5064d3e 100644 --- a/Riot/Assets/nl.lproj/Vector.strings +++ b/Riot/Assets/nl.lproj/Vector.strings @@ -1065,7 +1065,7 @@ "secrets_recovery_reset_action_part_1" = "Alle herstelopties vergeten of verloren? "; "user_verification_session_details_verify_action_other_user" = "Handmatig verifiëren"; "user_verification_session_details_verify_action_current_user_manually" = "Handmatig middels een tekst"; -"user_verification_session_details_verify_action_current_user" = "Interactief Verifiëren"; +"user_verification_session_details_verify_action_current_user" = "Interactief verifiëren"; "user_verification_session_details_additional_information_untrusted_current_user" = "Als u zich niet heeft aangemeld bij deze sessie, is uw account wellicht geschonden."; "user_verification_session_details_additional_information_untrusted_other_user" = "Totdat deze persoon deze sessie vertrouwd, zijn berichten gelabeld met waarschuwingen. Een andere mogelijkheid is om de persoon handmatig te verifiëren."; "user_verification_session_details_information_untrusted_other_user" = " heeft zich in een nieuwe sessie aangemeld:"; @@ -1266,7 +1266,7 @@ // Room widget permissions "room_widget_permission_title" = "Widget laden"; "widget_picker_manage_integrations" = "Beheer integraties…"; -"widget_integration_manager_disabled" = "U moet een integratebeheerder inschakelen in uw instellingen"; +"widget_integration_manager_disabled" = "U moet integratiebeheer inschakelen in de instellingen"; "widget_menu_remove" = "Verwijderen voor iedereen"; "widget_menu_revoke_permission" = "Toegang intrekken voor mij"; "widget_menu_open_outside" = "Openen in browser"; From 34891e4853f2d9d19f2bc883972e1228975a578a Mon Sep 17 00:00:00 2001 From: langleyd Date: Sun, 4 Jul 2021 10:46:17 +0100 Subject: [PATCH 18/72] Add avatar view and title --- .../RoomNotificationSettingsAvatarView.swift | 50 ++++++++++++++++ .../RoomNotificationSettingsAvatarView.xib | 57 +++++++++++++++++++ .../RoomNotificationSettingsCoordinator.swift | 10 +++- ...omNotificationSettingsViewController.swift | 9 +++ .../RoomNotificationSettingsViewModel.swift | 4 +- ...oomNotificationSettingsViewStateType.swift | 2 + .../Room/RoomInfo/RoomInfoCoordinator.swift | 2 +- 7 files changed, 129 insertions(+), 5 deletions(-) create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.xib diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift new file mode 100644 index 000000000..7abc30c36 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift @@ -0,0 +1,50 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation +import Reusable + +struct RoomNotificationSettingsAvatarViewData { + let avatarUrl: String? + let mediaManager: MXMediaManager? + let displayName: String? + let roomId: String +} + +class RoomNotificationSettingsAvatarView: UIView, NibLoadable { + + @IBOutlet weak var avatarView: MXKImageView! + @IBOutlet weak var nameLabel: UILabel! + + func configure(viewData: RoomNotificationSettingsAvatarViewData) { + let avatarImage = AvatarGenerator.generateAvatar(forMatrixItem: viewData.roomId, withDisplayName: viewData.displayName) + + if let avatarUrl = viewData.avatarUrl { + avatarView.enableInMemoryCache = true + + avatarView.setImageURI(avatarUrl, + withType: nil, + andImageOrientation: .up, + toFitViewSize: avatarView.frame.size, + with: MXThumbnailingMethodCrop, + previewImage: avatarImage, + mediaManager: viewData.mediaManager) + } else { + avatarView.image = avatarImage + } + nameLabel.text = viewData.displayName + } +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.xib b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.xib new file mode 100644 index 000000000..b9c21f892 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.xib @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift index a377dd2b0..e3b7dae9a 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift @@ -36,9 +36,15 @@ final class RoomNotificationSettingsCoordinator: RoomNotificationSettingsCoordin // MARK: - Setup - init(room: MXRoom) { + init(room: MXRoom, showAvatar: Bool = true) { let repository = RoomNotificationSettingsService(room: room) - let roomNotificationSettingsViewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: repository, roomEncrypted: room.summary.isEncrypted) + + let avatarData = showAvatar ? RoomNotificationSettingsAvatarViewData( + avatarUrl: room.summary.avatar, + mediaManager: room.mxSession.mediaManager, + displayName: room.summary.displayname, + roomId: room.roomId) : nil + let roomNotificationSettingsViewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: repository, roomEncrypted: room.summary.isEncrypted, avatarViewData: avatarData) let roomNotificationSettingsViewController = RoomNotificationSettingsViewController.instantiate(with: roomNotificationSettingsViewModel) self.roomNotificationSettingsViewModel = roomNotificationSettingsViewModel self.roomNotificationSettingsViewController = roomNotificationSettingsViewController diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index 7135aaa95..db5d3df66 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -34,6 +34,9 @@ final class RoomNotificationSettingsViewController: UIViewController { private var theme: Theme! private var errorPresenter: MXKErrorPresentation! private var activityPresenter: ActivityIndicatorPresenter! + private lazy var avatarView: RoomNotificationSettingsAvatarView = { + RoomNotificationSettingsAvatarView.loadFromNib() + }() private struct Row { var cellState: RoomNotificationSettingsCell.State @@ -107,6 +110,8 @@ final class RoomNotificationSettingsViewController: UIViewController { } private func setupViews() { + + self.title = VectorL10n.roomDetailsNotifs let doneBarButtonItem = MXKBarButtonItem(title: VectorL10n.roomNotifsSettingsDoneAction, style: .plain) { [weak self] in self?.viewModel.process(viewAction: .save) } @@ -133,6 +138,10 @@ final class RoomNotificationSettingsViewController: UIViewController { activityPresenter.removeCurrentActivityIndicator(animated: true) } self.viewState = viewState + if let avatarData = viewState.avatarData { + mainTableView.tableHeaderView = avatarView + avatarView.configure(viewData: avatarData) + } updateSections() } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift index 961770b33..511269c52 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift @@ -39,11 +39,11 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel // MARK: - Setup - init(roomNotificationRepository: RoomNotificationSettingsServiceType, roomEncrypted: Bool) { + init(roomNotificationRepository: RoomNotificationSettingsServiceType, roomEncrypted: Bool, avatarViewData: RoomNotificationSettingsAvatarViewData?) { self.roomNotificationRepository = roomNotificationRepository let notificationState = Self.mapNotificationStateOnRead(encrypted: roomEncrypted, state: roomNotificationRepository.notificationState) - self.state = RoomNotificationSettingsViewState(roomEncrypted: roomEncrypted, saving: false, notificationState: notificationState) + self.state = RoomNotificationSettingsViewState(roomEncrypted: roomEncrypted, saving: false, notificationState: notificationState, avatarData: avatarViewData) self.roomNotificationRepository.observeNotificationState { [weak self] state in guard let self = self else { return } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift index 01bc56261..5d35fe9cd 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift @@ -30,6 +30,7 @@ struct RoomNotificationSettingsViewState: RoomNotificationSettingsViewStateType return RoomNotificationState.allCases } } + let avatarData: RoomNotificationSettingsAvatarViewData? } protocol RoomNotificationSettingsViewStateType { @@ -37,4 +38,5 @@ protocol RoomNotificationSettingsViewStateType { var roomEncrypted: Bool { get } var notificationOptions: [RoomNotificationState] { get } var notificationState: RoomNotificationState { get } + var avatarData: RoomNotificationSettingsAvatarViewData? { get } } diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift b/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift index 5776bccbd..495d3468b 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoCoordinator.swift @@ -138,7 +138,7 @@ final class RoomInfoCoordinator: NSObject, RoomInfoCoordinatorType { } private func createRoomNotificationSettingsCoordinator() -> RoomNotificationSettingsCoordinator { - let coordinator = RoomNotificationSettingsCoordinator(room: room) + let coordinator = RoomNotificationSettingsCoordinator(room: room, showAvatar: false) coordinator.delegate = self return coordinator } From 8c515d8fd4d5b1cb998b50b472e879cfef4a0184 Mon Sep 17 00:00:00 2001 From: langleyd Date: Sun, 4 Jul 2021 17:01:42 +0100 Subject: [PATCH 19/72] Add ViewModel tests and change avatar data to use existing AvatarViewDataProtocol --- .../RoomNotificationSettingsAvatarView.swift | 11 +- .../RoomNotificationSettingsCoordinator.swift | 9 +- ...omNotificationSettingsViewController.swift | 6 +- .../RoomNotificationSettingsViewModel.swift | 2 +- ...oomNotificationSettingsViewModelType.swift | 2 +- ...oomNotificationSettingsViewStateType.swift | 4 +- ...omNotificationSettingsViewModelTests.swift | 146 ++++++++++++++++++ 7 files changed, 161 insertions(+), 19 deletions(-) create mode 100644 RiotTests/RoomNotificationSettingsViewModelTests.swift diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift index 7abc30c36..39fe4dbec 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift @@ -17,20 +17,13 @@ import Foundation import Reusable -struct RoomNotificationSettingsAvatarViewData { - let avatarUrl: String? - let mediaManager: MXMediaManager? - let displayName: String? - let roomId: String -} - class RoomNotificationSettingsAvatarView: UIView, NibLoadable { @IBOutlet weak var avatarView: MXKImageView! @IBOutlet weak var nameLabel: UILabel! - func configure(viewData: RoomNotificationSettingsAvatarViewData) { - let avatarImage = AvatarGenerator.generateAvatar(forMatrixItem: viewData.roomId, withDisplayName: viewData.displayName) + func configure(viewData: AvatarViewDataProtocol) { + let avatarImage = AvatarGenerator.generateAvatar(forMatrixItem: viewData.matrixItemId, withDisplayName: viewData.displayName) if let avatarUrl = viewData.avatarUrl { avatarView.enableInMemoryCache = true diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift index e3b7dae9a..134abafc1 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift @@ -39,11 +39,12 @@ final class RoomNotificationSettingsCoordinator: RoomNotificationSettingsCoordin init(room: MXRoom, showAvatar: Bool = true) { let repository = RoomNotificationSettingsService(room: room) - let avatarData = showAvatar ? RoomNotificationSettingsAvatarViewData( - avatarUrl: room.summary.avatar, - mediaManager: room.mxSession.mediaManager, + let avatarData = showAvatar ? RoomAvatarViewData( + roomId: room.roomId, displayName: room.summary.displayname, - roomId: room.roomId) : nil + avatarUrl: room.summary.avatar, + mediaManager: room.mxSession.mediaManager + ) : nil let roomNotificationSettingsViewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: repository, roomEncrypted: room.summary.isEncrypted, avatarViewData: avatarData) let roomNotificationSettingsViewController = RoomNotificationSettingsViewController.instantiate(with: roomNotificationSettingsViewModel) self.roomNotificationSettingsViewModel = roomNotificationSettingsViewModel diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index db5d3df66..6d39381e8 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -21,9 +21,11 @@ import UIKit final class RoomNotificationSettingsViewController: UIViewController { // MARK: - Properties + private enum Constants { static let linkToAccountSettings = "linkToAccountSettings" } + // MARK: Outlets @IBOutlet private weak var mainTableView: UITableView! @@ -161,7 +163,7 @@ final class RoomNotificationSettingsViewController: UIViewController { } } -// MARK - UITableViewDataSource +// MARK: - UITableViewDataSource extension RoomNotificationSettingsViewController: UITableViewDataSource { func numberOfSections(in tableView: UITableView) -> Int { @@ -187,7 +189,7 @@ extension RoomNotificationSettingsViewController: UITableViewDataSource { } -// MARK - UITableViewDelegate +// MARK: - UITableViewDelegate extension RoomNotificationSettingsViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift index 511269c52..343864d4b 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift @@ -39,7 +39,7 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel // MARK: - Setup - init(roomNotificationRepository: RoomNotificationSettingsServiceType, roomEncrypted: Bool, avatarViewData: RoomNotificationSettingsAvatarViewData?) { + init(roomNotificationRepository: RoomNotificationSettingsServiceType, roomEncrypted: Bool, avatarViewData: AvatarViewDataProtocol?) { self.roomNotificationRepository = roomNotificationRepository let notificationState = Self.mapNotificationStateOnRead(encrypted: roomEncrypted, state: roomNotificationRepository.notificationState) diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift index d6f470e16..b43a2a325 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift @@ -19,7 +19,7 @@ import Foundation protocol RoomNotificationSettingsViewModelViewDelegate: AnyObject { - func roomNotificationSettingsViewModel(_ viewModel: RoomNotificationSettingsViewModelType, didUpdateViewState viewSate: RoomNotificationSettingsViewStateType) + func roomNotificationSettingsViewModel(_ viewModel: RoomNotificationSettingsViewModelType, didUpdateViewState viewState: RoomNotificationSettingsViewStateType) } protocol RoomNotificationSettingsViewModelCoordinatorDelegate: AnyObject { diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift index 5d35fe9cd..48e9d6290 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift @@ -30,7 +30,7 @@ struct RoomNotificationSettingsViewState: RoomNotificationSettingsViewStateType return RoomNotificationState.allCases } } - let avatarData: RoomNotificationSettingsAvatarViewData? + let avatarData: AvatarViewDataProtocol? } protocol RoomNotificationSettingsViewStateType { @@ -38,5 +38,5 @@ protocol RoomNotificationSettingsViewStateType { var roomEncrypted: Bool { get } var notificationOptions: [RoomNotificationState] { get } var notificationState: RoomNotificationState { get } - var avatarData: RoomNotificationSettingsAvatarViewData? { get } + var avatarData: AvatarViewDataProtocol? { get } } diff --git a/RiotTests/RoomNotificationSettingsViewModelTests.swift b/RiotTests/RoomNotificationSettingsViewModelTests.swift new file mode 100644 index 000000000..5afe0a47c --- /dev/null +++ b/RiotTests/RoomNotificationSettingsViewModelTests.swift @@ -0,0 +1,146 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import XCTest +@testable import Riot + + +class MockRoomNotificationSettingsService: RoomNotificationSettingsServiceType { + + var listener: NotificationSettingCallback? + var notificationState: RoomNotificationState + + init(initialState: RoomNotificationState) { + notificationState = initialState + } + + func observeNotificationState(listener: @escaping NotificationSettingCallback) { + self.listener = listener + } + + func update(state: RoomNotificationState, completion: @escaping Completion) { + self.notificationState = state + completion() + listener?(state) + } +} + +class MockRoomNotificationSettingsView: RoomNotificationSettingsViewModelViewDelegate { + + var viewState: RoomNotificationSettingsViewStateType? + + func roomNotificationSettingsViewModel(_ viewModel: RoomNotificationSettingsViewModelType, didUpdateViewState viewState: RoomNotificationSettingsViewStateType) { + self.viewState = viewState + } +} + +class MockRoomNotificationSettingsCoordinator: RoomNotificationSettingsViewModelCoordinatorDelegate { + + var didComplete = false + var didCancel = false + func roomNotificationSettingsViewModelDidComplete(_ viewModel: RoomNotificationSettingsViewModelType) { + didComplete = true + } + + func roomNotificationSettingsViewModelDidCancel(_ viewModel: RoomNotificationSettingsViewModelType) { + didCancel = true + } +} + +class RoomNotificationSettingsViewModelTests: XCTestCase { + + enum Constants{ + static let roomDisplayName: String = "Test Room Name" + static let roomId: String = "1" + static let avatarUrl: String = "http://test.url.com" + static let avatarData = RoomAvatarViewData(roomId: "1", displayName: roomDisplayName, avatarUrl: avatarUrl, mediaManager: MXMediaManager()) + } + + var coordinator: MockRoomNotificationSettingsCoordinator! + var service: MockRoomNotificationSettingsService! + var view: MockRoomNotificationSettingsView! + var viewModel: RoomNotificationSettingsViewModel! + + override func setUpWithError() throws { + service = MockRoomNotificationSettingsService(initialState: .all) + view = MockRoomNotificationSettingsView() + coordinator = MockRoomNotificationSettingsCoordinator() + } + + func setupViewModel(roomEncrypted: Bool, showAvatar: Bool) { + let avatarData = showAvatar ? Constants.avatarData : nil + let viewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: service, roomEncrypted: roomEncrypted, avatarViewData: avatarData) + viewModel.viewDelegate = view + viewModel.coordinatorDelegate = coordinator + self.viewModel = viewModel + } + + func testUnloaded() throws { + setupViewModel(roomEncrypted: true, showAvatar: false) + XCTAssertNil(view.viewState) + } + + func testUnencryptedOptions() throws { + setupViewModel(roomEncrypted: false, showAvatar: false) + viewModel.process(viewAction: .load) + XCTAssertNotNil(view.viewState) + XCTAssertTrue(view.viewState!.notificationOptions.count == 3) + } + + func testEncryptedOptions() throws { + setupViewModel(roomEncrypted: true, showAvatar: false) + viewModel.process(viewAction: .load) + XCTAssertNotNil(view.viewState) + XCTAssertTrue(view.viewState!.notificationOptions.count == 2) + } + + func testAvatar() throws { + setupViewModel(roomEncrypted: true, showAvatar: true) + viewModel.process(viewAction: .load) + XCTAssertNotNil(view.viewState?.avatarData) + XCTAssertEqual(view.viewState!.avatarData!.avatarUrl, Constants.avatarUrl) + } + + func testSelectionUpdateAndSave() throws { + setupViewModel(roomEncrypted: false, showAvatar: false) + 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: .save) + XCTAssertTrue(service.notificationState == .mentionsOnly) + XCTAssertTrue(coordinator.didComplete) + } + + func testCancel() throws { + setupViewModel(roomEncrypted: false, showAvatar: false) + viewModel.process(viewAction: .load) + XCTAssertNotNil(view.viewState) + viewModel.process(viewAction: .cancel) + XCTAssertTrue(coordinator.didCancel) + } + + func testMentionsOnlyNotAvaileOnEncryptedRoom() throws { + service = MockRoomNotificationSettingsService(initialState: .mentionsOnly) + setupViewModel(roomEncrypted: true, showAvatar: false) + + viewModel.process(viewAction: .load) + XCTAssertNotNil(view.viewState) + XCTAssertTrue(view.viewState!.notificationState == .mute) + } + +} From 213bfc817d06db213c1c26daff304f3e4253f132 Mon Sep 17 00:00:00 2001 From: langleyd Date: Sun, 4 Jul 2021 17:06:19 +0100 Subject: [PATCH 20/72] Change in behaviour: mute should actually mean mute on update now. --- .../RoomNotificationSettingsViewModel.swift | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift index 343864d4b..65eb9f222 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift @@ -61,8 +61,7 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel self.state.notificationState = state case .save: self.state.saving = true - let updateState = Self.mapNotificationStateOnUpdate(encrypted: self.state.roomEncrypted, state: state.notificationState) - roomNotificationRepository.update(state: updateState) { [weak self] in + roomNotificationRepository.update(state: state.notificationState) { [weak self] in guard let self = self else { return } self.state.saving = false self.coordinatorDelegate?.roomNotificationSettingsViewModelDidComplete(self) @@ -83,15 +82,6 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel } } - private static func mapNotificationStateOnUpdate(encrypted: Bool, state: RoomNotificationState) -> RoomNotificationState { - if encrypted, case .mute = state { - // Notifications not supported on encrypted rooms, map mute to mentions only on update - return .mentionsOnly - } else { - return state - } - } - private func update(viewState: RoomNotificationSettingsViewStateType) { self.viewDelegate?.roomNotificationSettingsViewModel(self, didUpdateViewState: viewState) } From acb88ffa121fcde42065934f0719e9110b022380 Mon Sep 17 00:00:00 2001 From: langleyd Date: Sun, 4 Jul 2021 17:27:19 +0100 Subject: [PATCH 21/72] Fix service naming --- .../RoomNotificationSettingsViewModel.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift index 65eb9f222..d8117f5a6 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift @@ -25,7 +25,7 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel // MARK: Private - private let roomNotificationRepository: RoomNotificationSettingsServiceType + private let roomNotificationService: RoomNotificationSettingsServiceType private var state: RoomNotificationSettingsViewState { willSet { update(viewState: newValue) @@ -39,12 +39,12 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel // MARK: - Setup - init(roomNotificationRepository: RoomNotificationSettingsServiceType, roomEncrypted: Bool, avatarViewData: AvatarViewDataProtocol?) { - self.roomNotificationRepository = roomNotificationRepository + init(roomNotificationService: RoomNotificationSettingsServiceType, roomEncrypted: Bool, avatarViewData: AvatarViewDataProtocol?) { + self.roomNotificationService = roomNotificationService - let notificationState = Self.mapNotificationStateOnRead(encrypted: roomEncrypted, state: roomNotificationRepository.notificationState) + let notificationState = Self.mapNotificationStateOnRead(encrypted: roomEncrypted, state: roomNotificationService.notificationState) self.state = RoomNotificationSettingsViewState(roomEncrypted: roomEncrypted, saving: false, notificationState: notificationState, avatarData: avatarViewData) - self.roomNotificationRepository.observeNotificationState { [weak self] state in + self.roomNotificationService.observeNotificationState { [weak self] state in guard let self = self else { return } self.state.notificationState = Self.mapNotificationStateOnRead(encrypted: roomEncrypted, state: state) @@ -61,7 +61,7 @@ final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModel self.state.notificationState = state case .save: self.state.saving = true - roomNotificationRepository.update(state: state.notificationState) { [weak self] in + roomNotificationService.update(state: state.notificationState) { [weak self] in guard let self = self else { return } self.state.saving = false self.coordinatorDelegate?.roomNotificationSettingsViewModelDidComplete(self) From b8a1117426a3c284c664f1ea87c84992f4a37693 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 4 Jul 2021 21:11:12 +0100 Subject: [PATCH 22/72] enable extendedLayoutIncludesOpaqueBars on the other tabs (not just Home) to fix iPhone 12 Pro Max layout issues fixes https://github.com/vector-im/element-ios/issues/4516 --- Riot/Assets/Base.lproj/Main.storyboard | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Riot/Assets/Base.lproj/Main.storyboard b/Riot/Assets/Base.lproj/Main.storyboard index aec7a4605..c562c4d0b 100644 --- a/Riot/Assets/Base.lproj/Main.storyboard +++ b/Riot/Assets/Base.lproj/Main.storyboard @@ -151,7 +151,7 @@ - + @@ -177,7 +177,7 @@ - + @@ -463,7 +463,7 @@ - + @@ -581,7 +581,7 @@ - + From 3c0c2ce6ac984755bff38ecd59ad9b0ac13d5f45 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sun, 4 Jul 2021 21:14:34 +0100 Subject: [PATCH 23/72] changelog --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2e72d9c8e..45ed2aabe 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,7 +8,7 @@ Changes to be released in next version * 🐛 Bugfix - * + * More fixes to Main.storyboard layout on iPhone 12 Pro Max (#4527) ⚠️ API Changes * From 9b7357e0e17641a6980205884ed2ff3114503ba0 Mon Sep 17 00:00:00 2001 From: Doug Date: Mon, 5 Jul 2021 11:59:35 +0100 Subject: [PATCH 24/72] Remove background colour from RoomsLiveViewController. --- .../Modules/Share/Listing/RoomsListViewController.xib | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.xib b/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.xib index 630d940a3..bc77d3275 100644 --- a/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.xib +++ b/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.xib @@ -1,11 +1,9 @@ - - - - + + - + @@ -39,7 +37,6 @@ - @@ -49,6 +46,7 @@ + From 3604c2de240ffdc789f8422c0684b89d04712880 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Mon, 5 Jul 2021 15:27:36 +0300 Subject: [PATCH 25/72] Do not present ended calls --- Riot/Managers/Call/CallPresenter.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Riot/Managers/Call/CallPresenter.swift b/Riot/Managers/Call/CallPresenter.swift index 4f5ad7e13..940ac98f3 100644 --- a/Riot/Managers/Call/CallPresenter.swift +++ b/Riot/Managers/Call/CallPresenter.swift @@ -393,7 +393,9 @@ class CallPresenter: NSObject { if let oldCallVC = self.callVCs.values.first, self.presentedCallVC == nil, !self.uiOperationQueue.containsPresentCallVCOperation, - !self.uiOperationQueue.containsEnterPiPOperation { + !self.uiOperationQueue.containsEnterPiPOperation, + let oldCall = oldCallVC.mxCall, + oldCall.state != .ended { // present the call screen after dismissing this one self.presentCallVC(oldCallVC) } From 3e1e9ce538779b40f865d19f8bdda3c1156aa092 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Mon, 5 Jul 2021 15:30:43 +0300 Subject: [PATCH 26/72] Update CHANGES.rst --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2e72d9c8e..982ac85cc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,7 +8,7 @@ Changes to be released in next version * 🐛 Bugfix - * + * VoIP: Do not present ended calls. ⚠️ API Changes * From 588974284597a381c547db5e7cefea0d2d1cdf7e Mon Sep 17 00:00:00 2001 From: langleyd Date: Mon, 5 Jul 2021 16:28:14 +0100 Subject: [PATCH 27/72] Fix build and naming of State -> ViewData --- ...RoomNotificationSettingsCellViewData.swift | 22 +++++++++++++++++++ .../RoomNotificationSettingsCoordinator.swift | 2 +- ...omNotificationSettingsViewController.swift | 8 +++---- .../RoomNotificationsSettingsCell.swift | 7 +----- 4 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCellViewData.swift diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCellViewData.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCellViewData.swift new file mode 100644 index 000000000..2b50835d1 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCellViewData.swift @@ -0,0 +1,22 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation + +struct RoomNotificationSettingsCellViewData { + let notificicationState: RoomNotificationState + let selected: Bool +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift index 134abafc1..25e663ae4 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift @@ -45,7 +45,7 @@ final class RoomNotificationSettingsCoordinator: RoomNotificationSettingsCoordin avatarUrl: room.summary.avatar, mediaManager: room.mxSession.mediaManager ) : nil - let roomNotificationSettingsViewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: repository, roomEncrypted: room.summary.isEncrypted, avatarViewData: avatarData) + let roomNotificationSettingsViewModel = RoomNotificationSettingsViewModel(roomNotificationService: repository, roomEncrypted: room.summary.isEncrypted, avatarViewData: avatarData) let roomNotificationSettingsViewController = RoomNotificationSettingsViewController.instantiate(with: roomNotificationSettingsViewModel) self.roomNotificationSettingsViewModel = roomNotificationSettingsViewModel self.roomNotificationSettingsViewController = roomNotificationSettingsViewController diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index 6d39381e8..3c6ce1f01 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -41,7 +41,7 @@ final class RoomNotificationSettingsViewController: UIViewController { }() private struct Row { - var cellState: RoomNotificationSettingsCell.State + var cellViewData: RoomNotificationSettingsCellViewData var action: (() -> Void)? } @@ -149,8 +149,8 @@ final class RoomNotificationSettingsViewController: UIViewController { private func updateSections() { let rows = viewState.notificationOptions.map({ (setting) -> Row in - let cellState = RoomNotificationSettingsCell.State(notificicationState: setting, selected: viewState.notificationState == setting) - return Row(cellState: cellState, + let cellViewData = RoomNotificationSettingsCellViewData(notificicationState: setting, selected: viewState.notificationState == setting) + return Row(cellViewData: cellViewData, action: { self.viewModel.process(viewAction: .selectNotificationState(setting)) }) @@ -177,7 +177,7 @@ extension RoomNotificationSettingsViewController: UITableViewDataSource { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let row = sections[indexPath.section].rows[indexPath.row] let cell: RoomNotificationSettingsCell = tableView.dequeueReusableCell(for: indexPath) - cell.update(state: row.cellState) + cell.update(state: row.cellViewData) cell.update(theme: theme) return cell } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift index 831c1ba73..2591b6c4e 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift @@ -18,12 +18,7 @@ import Reusable class RoomNotificationSettingsCell: UITableViewCell { - struct State { - let notificicationState: RoomNotificationState - let selected: Bool - } - - func update(state: State) { + func update(state: RoomNotificationSettingsCellViewData) { textLabel?.font = .systemFont(ofSize: 17) detailTextLabel?.font = .systemFont(ofSize: 16) textLabel?.text = state.notificicationState.title From dd3cab44e2880245a4248d536ea393eea1de40be Mon Sep 17 00:00:00 2001 From: langleyd Date: Mon, 5 Jul 2021 16:49:06 +0100 Subject: [PATCH 28/72] spacing and cleanup dead code --- Riot/Assets/en.lproj/Vector.strings | 1 - .../Common/Recents/RecentsViewController.m | 13 ++-------- ... => RoomNotifcationsSettingsService.swift} | 18 ++------------ .../RoomNotificationSettingsFooter.swift | 3 +-- .../RoomNotificationSettingsSerivceType.swift | 24 +++++++++++++++++++ .../RoomNotificationSettingsViewModel.swift | 1 - .../RoomNotificationState.swift | 23 ++++++++++++++++++ 7 files changed, 52 insertions(+), 31 deletions(-) rename Riot/Modules/Room/NotificationSettings/{RoomNotifcationsService.swift => RoomNotifcationsSettingsService.swift} (96%) create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsSerivceType.swift create mode 100644 Riot/Modules/Room/NotificationSettings/RoomNotificationState.swift diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index f9b75b276..ab0cccfab 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -783,7 +783,6 @@ Tap the + to start adding people."; "room_notifs_settings_account_settings" = "Account settings"; "room_notifs_settings_encrypted_room_notice" = "Please note that mentions & keyword notifications are not available in encrypted rooms on mobile."; - // Group Details "group_details_title" = "Community Details"; "group_details_home" = "Home"; diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index a185a4753..3cfe7b938 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -1317,16 +1317,6 @@ } } -- (void)openNotificationsSettings -{ - if (self.mainSession) - { - self.createRoomCoordinatorBridgePresenter = [[CreateRoomCoordinatorBridgePresenter alloc] initWithSession:self.mainSession]; - self.createRoomCoordinatorBridgePresenter.delegate = self; - [self.createRoomCoordinatorBridgePresenter presentFrom:self animated:YES]; - } -} - #pragma mark - UITableView delegate - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; @@ -2207,10 +2197,11 @@ } } +#pragma mark - RoomNotificationSettingsCoordinatorBridgePresenterDelegate -(void)roomNotificationSettingsCoordinatorBridgePresenterDelegateDidComplete:(RoomNotificationSettingsCoordinatorBridgePresenter *)coordinatorBridgePresenter { [coordinatorBridgePresenter dismissWithAnimated:YES completion:nil]; - self.roomsDirectoryCoordinatorBridgePresenter = nil; + self.roomNotificationSettingsCoordinatorBridgePresenter = nil; } @end diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsService.swift b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift similarity index 96% rename from Riot/Modules/Room/NotificationSettings/RoomNotifcationsService.swift rename to Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift index 615a151cd..e47ce9862 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsService.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift @@ -16,22 +16,10 @@ import Foundation -enum RoomNotificationState: CaseIterable { - case all - case mentionsOnly - case mute -} - -protocol RoomNotificationSettingsServiceType { +final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType { + typealias Completion = () -> Void typealias NotificationSettingCallback = (RoomNotificationState) -> Void - - func observeNotificationState(listener: @escaping NotificationSettingCallback) - func update(state: RoomNotificationState, completion: @escaping Completion) - var notificationState: RoomNotificationState { get } -} - -final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType { // MARK: - Properties @@ -74,7 +62,6 @@ final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType observers += [ObjectIdentifier(observer)] } - func update(state: RoomNotificationState, completion: @escaping Completion) { switch state { case .all: @@ -208,7 +195,6 @@ final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType ) } - private func removePushRule(rule: MXPushRule, completion: @escaping Completion) { handleUpdateCallback(completion) { [weak self] in guard let self = self else { return true } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift index 4ccf9a124..12f7a2901 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift @@ -28,6 +28,7 @@ class RoomNotificationSettingsFooter: UITableViewHeaderFooterView { func update(footerState: State) { + // Don't include link until global settings in place // let paragraphStyle = NSMutableParagraphStyle() // paragraphStyle.lineHeightMultiple = 1.16 // let paragraphAttributes: [NSAttributedString.Key: Any] = [ @@ -35,8 +36,6 @@ class RoomNotificationSettingsFooter: UITableViewHeaderFooterView { // NSAttributedString.Key.paragraphStyle: paragraphStyle, // NSAttributedString.Key.font: UIFont.systemFont(ofSize: 13.0) // ] - - // Don't include link until global settings in place // let linkStr = VectorL10n.roomNotifsSettingsAccountSettings // let formatStr = VectorL10n.roomNotifsSettingsManageNotifications(linkStr) // diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsSerivceType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsSerivceType.swift new file mode 100644 index 000000000..2499ac0d0 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsSerivceType.swift @@ -0,0 +1,24 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation + +protocol RoomNotificationSettingsServiceType { + + func observeNotificationState(listener: @escaping (RoomNotificationState) -> Void) + func update(state: RoomNotificationState, completion: @escaping () -> Void) + var notificationState: RoomNotificationState { get } +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift index d8117f5a6..3d7d22b09 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift @@ -18,7 +18,6 @@ import Foundation - final class RoomNotificationSettingsViewModel: RoomNotificationSettingsViewModelType { // MARK: - Properties diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationState.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationState.swift new file mode 100644 index 000000000..8d37a6702 --- /dev/null +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationState.swift @@ -0,0 +1,23 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation + +enum RoomNotificationState: CaseIterable { + case all + case mentionsOnly + case mute +} From 7b1d27f60311463b4eda64484c70757809333f59 Mon Sep 17 00:00:00 2001 From: Doug Date: Mon, 5 Jul 2021 17:48:53 +0100 Subject: [PATCH 29/72] Fix documentation warning. --- Riot/Model/Room/RoomPreviewData.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Riot/Model/Room/RoomPreviewData.h b/Riot/Model/Room/RoomPreviewData.h index 71280b099..c10295617 100644 --- a/Riot/Model/Room/RoomPreviewData.h +++ b/Riot/Model/Room/RoomPreviewData.h @@ -76,10 +76,17 @@ Contructors. @param roomId the id of the room. - @param emailInvitationParams, in case of an email invitation link, the query parameters extracted from the link. @param mxSession the session to open the room preview with. */ - (instancetype)initWithRoomId:(NSString*)roomId andSession:(MXSession*)mxSession; + +/** + Contructors. + + @param roomId the id of the room. + @param emailInvitationParams in case of an email invitation link, the query parameters extracted from the link. + @param mxSession the session to open the room preview with. + */ - (instancetype)initWithRoomId:(NSString*)roomId emailInvitationParams:(NSDictionary*)emailInvitationParams andSession:(MXSession*)mxSession; /** From 07ec3d2f5229c54a44b2d855bdd689cbdafcf549 Mon Sep 17 00:00:00 2001 From: Doug Date: Mon, 5 Jul 2021 19:19:51 +0100 Subject: [PATCH 30/72] Fix crash when running on macOS with Apple Silicon. --- Riot/Modules/Application/LegacyAppDelegate.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index ff81e5f57..32010f9bb 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -351,6 +351,9 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni NSURL *messageSoundURL = [[NSBundle mainBundle] URLForResource:@"message" withExtension:@"caf"]; AudioServicesCreateSystemSoundID((__bridge CFURLRef)messageSoundURL, &_messageSound); + // Set app info now as Mac (Designed for iPad) accesses it before didFinishLaunching is called + self.appInfo = AppInfo.current; + MXLogDebug(@"[AppDelegate] willFinishLaunchingWithOptions: Done"); return YES; @@ -371,8 +374,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni _configuration = [AppConfiguration new]; - self.appInfo = AppInfo.current; - // Log app information NSString *appDisplayName = self.appInfo.displayName; NSString* appVersion = self.appVersion; From ebcb3e7124c9b7b953f4a607f046cc279333fb2c Mon Sep 17 00:00:00 2001 From: Doug Date: Mon, 5 Jul 2021 19:21:16 +0100 Subject: [PATCH 31/72] Update CHANGES.rst. --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2e72d9c8e..e6b12a975 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,7 +8,7 @@ Changes to be released in next version * 🐛 Bugfix - * + * Fix crash on Apple Silicon Macs. ⚠️ API Changes * From e74e292fcd60f8bfa751976cf66aadcb17dc1a6b Mon Sep 17 00:00:00 2001 From: Doug Date: Tue, 6 Jul 2021 10:41:47 +0100 Subject: [PATCH 32/72] Generate video thumbnails with the correct orientation. --- CHANGES.rst | 1 + Riot/Modules/MediaPicker/MediaPickerViewController.m | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 04c0012ef..5837d3a37 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,7 @@ Changes to be released in next version 🐛 Bugfix * VoIP: Do not present ended calls. * More fixes to Main.storyboard layout on iPhone 12 Pro Max (#4527) + * Media Picker: Generate video thumbnails with the correct orientation (#4515). ⚠️ API Changes * diff --git a/Riot/Modules/MediaPicker/MediaPickerViewController.m b/Riot/Modules/MediaPicker/MediaPickerViewController.m index 6b7725a11..d08e6ab17 100644 --- a/Riot/Modules/MediaPicker/MediaPickerViewController.m +++ b/Riot/Modules/MediaPicker/MediaPickerViewController.m @@ -736,6 +736,7 @@ // create a thumbnail for the first frame AVAsset *asset = [AVAsset assetWithURL:selectedVideoURL]; AVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset]; + generator.appliesPreferredTrackTransform = YES; CGImageRef thumbnailRef = [generator copyCGImageAtTime:kCMTimeZero actualTime:nil error:nil]; // set thumbnail on validationView From 74d4356c89836f0d919abaeaa4efa54f4a396bbb Mon Sep 17 00:00:00 2001 From: langleyd Date: Tue, 6 Jul 2021 11:38:29 +0100 Subject: [PATCH 33/72] Fix build, mute bug and footer label on unencrypted builds --- .../RoomNotifcationsSettingsService.swift | 5 ++--- .../RoomNotificationSettingsFooter.swift | 6 +++--- .../RoomNotificationSettingsSerivceType.swift | 7 +++++-- RiotTests/RoomNotificationSettingsViewModelTests.swift | 8 ++++---- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift index e47ce9862..c9d89f1b4 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift @@ -19,7 +19,6 @@ import Foundation final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType { typealias Completion = () -> Void - typealias NotificationSettingCallback = (RoomNotificationState) -> Void // MARK: - Properties @@ -50,7 +49,7 @@ final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType // MARK: - Public - func observeNotificationState(listener: @escaping NotificationSettingCallback) { + func observeNotificationState(listener: @escaping RoomNotificationStateCallback) { let observer = NotificationCenter.default.addObserver( forName: NSNotification.Name(rawValue: kMXNotificationCenterDidUpdateRules), @@ -81,7 +80,7 @@ final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType return } - if let rule = room.roomPushRule, room.isMentionsOnly { + if let rule = room.roomPushRule { removePushRule(rule: rule) { self.mute(completion: completion) } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift index 12f7a2901..db5285192 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsFooter.swift @@ -43,9 +43,9 @@ class RoomNotificationSettingsFooter: UITableViewHeaderFooterView { // let footer0 = NSMutableAttributedString(string: formattedStr, attributes: paragraphAttributes) // let linkRange = (footer0.string as NSString).range(of: linkStr) // footer0.addAttribute(NSAttributedString.Key.link, value: Constants.linkToAccountSettings, range: linkRange) - if footerState.showEncryptedNotice { - label.text = VectorL10n.roomNotifsSettingsEncryptedRoomNotice - } + + label.text = footerState.showEncryptedNotice ? VectorL10n.roomNotifsSettingsEncryptedRoomNotice : nil + } } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsSerivceType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsSerivceType.swift index 2499ac0d0..22961ad03 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsSerivceType.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsSerivceType.swift @@ -16,9 +16,12 @@ import Foundation +typealias UpdateRoomNotificationStateCompletion = () -> Void +typealias RoomNotificationStateCallback = (RoomNotificationState) -> Void + protocol RoomNotificationSettingsServiceType { - func observeNotificationState(listener: @escaping (RoomNotificationState) -> Void) - func update(state: RoomNotificationState, completion: @escaping () -> Void) + func observeNotificationState(listener: @escaping RoomNotificationStateCallback) + func update(state: RoomNotificationState, completion: @escaping UpdateRoomNotificationStateCompletion) var notificationState: RoomNotificationState { get } } diff --git a/RiotTests/RoomNotificationSettingsViewModelTests.swift b/RiotTests/RoomNotificationSettingsViewModelTests.swift index 5afe0a47c..6f2615e4e 100644 --- a/RiotTests/RoomNotificationSettingsViewModelTests.swift +++ b/RiotTests/RoomNotificationSettingsViewModelTests.swift @@ -20,18 +20,18 @@ import XCTest class MockRoomNotificationSettingsService: RoomNotificationSettingsServiceType { - var listener: NotificationSettingCallback? + var listener: RoomNotificationStateCallback? var notificationState: RoomNotificationState init(initialState: RoomNotificationState) { notificationState = initialState } - func observeNotificationState(listener: @escaping NotificationSettingCallback) { + func observeNotificationState(listener: @escaping RoomNotificationStateCallback) { self.listener = listener } - func update(state: RoomNotificationState, completion: @escaping Completion) { + func update(state: RoomNotificationState, completion: @escaping UpdateRoomNotificationStateCompletion) { self.notificationState = state completion() listener?(state) @@ -82,7 +82,7 @@ class RoomNotificationSettingsViewModelTests: XCTestCase { func setupViewModel(roomEncrypted: Bool, showAvatar: Bool) { let avatarData = showAvatar ? Constants.avatarData : nil - let viewModel = RoomNotificationSettingsViewModel(roomNotificationRepository: service, roomEncrypted: roomEncrypted, avatarViewData: avatarData) + let viewModel = RoomNotificationSettingsViewModel(roomNotificationService: service, roomEncrypted: roomEncrypted, avatarViewData: avatarData) viewModel.viewDelegate = view viewModel.coordinatorDelegate = coordinator self.viewModel = viewModel From 6a8c64ea5aa5f817d6cd1cd68aef2107f9fbc265 Mon Sep 17 00:00:00 2001 From: langleyd Date: Tue, 6 Jul 2021 11:59:54 +0100 Subject: [PATCH 34/72] Keep old mute behaviour enabled on slide menu and long press when new build setting is not enabled. --- .../Common/Recents/RecentsViewController.h | 5 ++ .../Common/Recents/RecentsViewController.m | 64 ++++++++++++++++++- Riot/Modules/Home/HomeViewController.m | 20 +++++- 3 files changed, 85 insertions(+), 4 deletions(-) diff --git a/Riot/Modules/Common/Recents/RecentsViewController.h b/Riot/Modules/Common/Recents/RecentsViewController.h index 70a504c8b..d3968cfd6 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.h +++ b/Riot/Modules/Common/Recents/RecentsViewController.h @@ -160,6 +160,11 @@ */ - (void)makeDirectEditedRoom:(BOOL)isDirect; +/** +Enable/disable the notifications for the selected room. +*/ +- (void)muteEditedRoomNotifications:(BOOL)mute; + /** Edit notification settings for the selected room. */ diff --git a/Riot/Modules/Common/Recents/RecentsViewController.m b/Riot/Modules/Common/Recents/RecentsViewController.m index 3cfe7b938..e76a83cab 100644 --- a/Riot/Modules/Common/Recents/RecentsViewController.m +++ b/Riot/Modules/Common/Recents/RecentsViewController.m @@ -1033,12 +1033,31 @@ UIContextualAction *muteAction = [UIContextualAction contextualActionWithStyle:UIContextualActionStyleDestructive title:title handler:^(UIContextualAction * _Nonnull action, __kindof UIView * _Nonnull sourceView, void (^ _Nonnull completionHandler)(BOOL)) { - [self changeEditedRoomNotificationSettings]; + + if ([BuildSettings roomSettingsScreenShowNotificationsV2]) + { + [self changeEditedRoomNotificationSettings]; + } + else + { + [self muteEditedRoomNotifications:!isMuted]; + } + + completionHandler(YES); }]; muteAction.backgroundColor = actionBackgroundColor; - UIImage *notificationImage = isMuted ? [UIImage imageNamed:@"room_action_notification_muted"] : [UIImage imageNamed:@"room_action_notification"]; + UIImage *notificationImage; + if([BuildSettings roomSettingsScreenShowNotificationsV2]) + { + notificationImage = isMuted ? [UIImage imageNamed:@"room_action_notification_muted"] : [UIImage imageNamed:@"room_action_notification"]; + } + else + { + notificationImage = [UIImage imageNamed:@"room_action_notification"]; + } + notificationImage = [notificationImage vc_tintedImageUsingColor:isMuted ? unselectedColor : selectedColor]; muteAction.image = [notificationImage vc_notRenderedImage]; @@ -1317,6 +1336,47 @@ } } +- (void)muteEditedRoomNotifications:(BOOL)mute +{ + if (editedRoomId) + { + // Check whether the user didn't leave the room + MXRoom *room = [self.mainSession roomWithRoomId:editedRoomId]; + if (room) + { + [self startActivityIndicator]; + + if (mute) + { + [room mentionsOnly:^{ + + [self stopActivityIndicator]; + + // Leave editing mode + [self cancelEditionMode:self->isRefreshPending]; + + }]; + } + else + { + [room allMessages:^{ + + [self stopActivityIndicator]; + + // Leave editing mode + [self cancelEditionMode:self->isRefreshPending]; + + }]; + } + } + else + { + // Leave editing mode + [self cancelEditionMode:isRefreshPending]; + } + } +} + #pragma mark - UITableView delegate - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; diff --git a/Riot/Modules/Home/HomeViewController.m b/Riot/Modules/Home/HomeViewController.m index 3f872cf2d..74fef7d37 100644 --- a/Riot/Modules/Home/HomeViewController.m +++ b/Riot/Modules/Home/HomeViewController.m @@ -347,7 +347,15 @@ tableViewCell.notificationsButton.tag = room.isMute || room.isMentionsOnly; [tableViewCell.notificationsButton addTarget:self action:@selector(onNotificationsButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; - tableViewCell.notificationsImageView.image = tableViewCell.notificationsButton.tag ? [UIImage imageNamed:@"room_action_notification_muted"] : [UIImage imageNamed:@"room_action_notification"]; + + if ([BuildSettings roomSettingsScreenShowNotificationsV2]) + { + tableViewCell.notificationsImageView.image = tableViewCell.notificationsButton.tag ? [UIImage imageNamed:@"room_action_notification_muted"] : [UIImage imageNamed:@"room_action_notification"]; + } + else + { + tableViewCell.notificationsImageView.image = [UIImage imageNamed:@"room_action_notification"]; + } tableViewCell.notificationsImageView.tintColor = tableViewCell.notificationsButton.tag ? unselectedColor : selectedColor; @@ -664,7 +672,15 @@ MXRoom *room = [self.mainSession roomWithRoomId:editedRoomId]; if (room) { - [self changeEditedRoomNotificationSettings]; + if ([BuildSettings roomSettingsScreenShowNotificationsV2]) + { + [self changeEditedRoomNotificationSettings]; + } + else + { + UIButton *button = (UIButton*)sender; + [self muteEditedRoomNotifications:!button.tag]; + } } } } From 017c6b3eeb5e17d421ea99e8f569112b0af1a87d Mon Sep 17 00:00:00 2001 From: langleyd Date: Tue, 6 Jul 2021 13:14:15 +0100 Subject: [PATCH 35/72] Enabled new room settings UI while I do ad hoc build --- Config/BuildSettings.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index 0d5ae6dae..58d074b82 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -295,7 +295,7 @@ final class BuildSettings: NSObject { static let roomSettingsScreenShowFlairSettings: Bool = true static let roomSettingsScreenShowAdvancedSettings: Bool = true static let roomSettingsScreenAdvancedShowEncryptToVerifiedOption: Bool = true - static let roomSettingsScreenShowNotificationsV2: Bool = false + static let roomSettingsScreenShowNotificationsV2: Bool = true // MARK: - Room Member Screen From 152d87768a268e72cbddae713e564239076b5bb0 Mon Sep 17 00:00:00 2001 From: langleyd Date: Tue, 6 Jul 2021 19:39:15 +0100 Subject: [PATCH 36/72] Fix typos, naming and copywright --- .../RoomNotificationSettingsCoordinator.swift | 2 +- .../RoomNotificationSettingsCoordinatorType.swift | 4 ++-- .../RoomNotificationSettingsViewAction.swift | 2 +- .../RoomNotificationSettingsViewController.swift | 2 +- .../RoomNotificationSettingsViewModel.swift | 4 ++-- .../RoomNotificationSettingsViewModelType.swift | 2 +- .../RoomNotificationSettingsViewStateType.swift | 2 +- .../Room/NotificationSettings/RoomNotificationState.swift | 2 +- .../RoomNotificationsSettingsCell.swift | 2 +- ...rvice.swift => RoomNotificationsSettingsService.swift} | 4 ++-- RiotTests/RoomNotificationSettingsViewModelTests.swift | 8 ++++---- 11 files changed, 17 insertions(+), 17 deletions(-) rename Riot/Modules/Room/NotificationSettings/{RoomNotifcationsSettingsService.swift => RoomNotificationsSettingsService.swift} (99%) diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift index 25e663ae4..2d8e48cee 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinator.swift @@ -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. diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinatorType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinatorType.swift index 99e30f617..ac0c6288b 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinatorType.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsCoordinatorType.swift @@ -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 } } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewAction.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewAction.swift index ee6539614..5d42f64fa 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewAction.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewAction.swift @@ -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. diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index 3c6ce1f01..21eb3e6e3 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -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. diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift index 3d7d22b09..e9f5729df 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModel.swift @@ -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 { diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift index b43a2a325..e2fe135d4 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewModelType.swift @@ -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. diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift index 48e9d6290..56de53b13 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewStateType.swift @@ -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. diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationState.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationState.swift index 8d37a6702..054993117 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationState.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationState.swift @@ -18,6 +18,6 @@ import Foundation enum RoomNotificationState: CaseIterable { case all - case mentionsOnly + case mentionsAndKeywordsOnly case mute } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift index 2591b6c4e..967859228 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift @@ -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 diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsService.swift similarity index 99% rename from Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift rename to Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsService.swift index c9d89f1b4..bb7e2fe81 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotifcationsSettingsService.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsService.swift @@ -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 } diff --git a/RiotTests/RoomNotificationSettingsViewModelTests.swift b/RiotTests/RoomNotificationSettingsViewModelTests.swift index 6f2615e4e..b10dbd63b 100644 --- a/RiotTests/RoomNotificationSettingsViewModelTests.swift +++ b/RiotTests/RoomNotificationSettingsViewModelTests.swift @@ -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) From 687d5e403da1241a6790ea44ac78493dd34ec14a Mon Sep 17 00:00:00 2001 From: langleyd Date: Tue, 6 Jul 2021 21:10:42 +0100 Subject: [PATCH 37/72] Use theme font types --- .../NotificationSettings/RoomNotificationsSettingsCell.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift index 967859228..3d4bec1f7 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift @@ -19,8 +19,6 @@ import Reusable class RoomNotificationSettingsCell: UITableViewCell { func update(state: RoomNotificationSettingsCellViewData) { - textLabel?.font = .systemFont(ofSize: 17) - detailTextLabel?.font = .systemFont(ofSize: 16) textLabel?.text = state.notificicationState.title if state.selected { accessoryView = UIImageView(image: Asset.Images.checkmark.image) @@ -34,8 +32,8 @@ extension RoomNotificationSettingsCell: Reusable {} extension RoomNotificationSettingsCell: Themable { func update(theme: Theme) { + textLabel?.font = theme.fonts.body textLabel?.textColor = theme.textPrimaryColor - detailTextLabel?.textColor = theme.textSecondaryColor backgroundColor = theme.backgroundColor contentView.backgroundColor = .clear tintColor = theme.tintColor From ac615e5ecb1f18bc41726dc37c05ff4d09bfeb1f Mon Sep 17 00:00:00 2001 From: langleyd Date: Tue, 6 Jul 2021 22:46:31 +0100 Subject: [PATCH 38/72] disable new settings ui again --- Config/BuildSettings.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index 58d074b82..0d5ae6dae 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -295,7 +295,7 @@ final class BuildSettings: NSObject { static let roomSettingsScreenShowFlairSettings: Bool = true static let roomSettingsScreenShowAdvancedSettings: Bool = true static let roomSettingsScreenAdvancedShowEncryptToVerifiedOption: Bool = true - static let roomSettingsScreenShowNotificationsV2: Bool = true + static let roomSettingsScreenShowNotificationsV2: Bool = false // MARK: - Room Member Screen From 105b1c5bd763a87d514fcd45b2f33e3365d0e953 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 8 Jul 2021 12:16:05 +0100 Subject: [PATCH 39/72] Rename roomsCount and moreThanRoomsCount to indicate they are for search results. Redefine roomsCount as the number of fetched rooms in the data source. --- .../Views/DirectoryRecentTableViewCell.m | 8 ++++---- .../PublicRoomsDirectoryDataSource.h | 11 ++++++++--- .../PublicRoomsDirectoryDataSource.m | 17 +++++++++++------ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Riot/Modules/GlobalSearch/Views/DirectoryRecentTableViewCell.m b/Riot/Modules/GlobalSearch/Views/DirectoryRecentTableViewCell.m index 63cdbfbce..26c103fb2 100644 --- a/Riot/Modules/GlobalSearch/Views/DirectoryRecentTableViewCell.m +++ b/Riot/Modules/GlobalSearch/Views/DirectoryRecentTableViewCell.m @@ -54,20 +54,20 @@ self.titleLabel.text = NSLocalizedStringFromTable(@"directory_search_results_title", @"Vector", nil); // Do we need to display like ">20 results found" or "18 results found"? - NSString *descriptionLabel = (publicRoomsDirectoryDataSource.moreThanRoomsCount && publicRoomsDirectoryDataSource.roomsCount > 0) ? NSLocalizedStringFromTable(@"directory_search_results_more_than", @"Vector", nil) : NSLocalizedStringFromTable(@"directory_search_results", @"Vector", nil); + NSString *descriptionLabel = (publicRoomsDirectoryDataSource.searchResultsCountIsLimited && publicRoomsDirectoryDataSource.searchResultsCount > 0) ? NSLocalizedStringFromTable(@"directory_search_results_more_than", @"Vector", nil) : NSLocalizedStringFromTable(@"directory_search_results", @"Vector", nil); self.descriptionLabel.text = [NSString stringWithFormat:descriptionLabel, - publicRoomsDirectoryDataSource.roomsCount, + publicRoomsDirectoryDataSource.searchResultsCount, publicRoomsDirectoryDataSource.searchPattern]; } else { self.titleLabel.text = NSLocalizedStringFromTable(@"directory_cell_title", @"Vector", nil); self.descriptionLabel.text = [NSString stringWithFormat:NSLocalizedStringFromTable(@"directory_cell_description", @"Vector", nil), - publicRoomsDirectoryDataSource.roomsCount]; + publicRoomsDirectoryDataSource.searchResultsCount]; } - if (publicRoomsDirectoryDataSource.roomsCount) + if (publicRoomsDirectoryDataSource.searchResultsCount) { self.userInteractionEnabled = YES; self.chevronImageView.hidden = NO; diff --git a/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.h b/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.h index 752cce049..73a4f9ed2 100644 --- a/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.h +++ b/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.h @@ -62,11 +62,16 @@ @property (nonatomic, readonly) NSString *directoryServerDisplayname; /** - The number of public rooms matching `searchPattern`. - It is accurate only if 'moreThanRoomsCount' is NO. + The number of public rooms that have been fetched so far. */ @property (nonatomic, readonly) NSUInteger roomsCount; +/** + The total number of public rooms matching `searchPattern`. + It is accurate only if 'moreThanRoomsCount' is NO. + */ +@property (nonatomic, readonly) NSUInteger searchResultsCount; + /** In case of search with a lot of matching public rooms, we cannot return an accurate value except by paginating the full list of rooms, which is not expected. @@ -74,7 +79,7 @@ This flag indicates that we know that there is more matching rooms than we got so far. */ -@property (nonatomic, readonly) BOOL moreThanRoomsCount; +@property (nonatomic, readonly) BOOL searchResultsCountIsLimited; /** The maximum number of public rooms to retrieve during a pagination. diff --git a/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.m b/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.m index e69035aa0..fa8ac0ab0 100644 --- a/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.m +++ b/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.m @@ -165,6 +165,11 @@ static NSString *const kNSFWKeyword = @"nsfw"; } } +- (NSUInteger)roomsCount +{ + return rooms.count; +} + - (NSIndexPath*)cellIndexPathWithRoomId:(NSString*)roomId andMatrixSession:(MXSession*)matrixSession { NSIndexPath *indexPath = nil; @@ -217,8 +222,8 @@ static NSString *const kNSFWKeyword = @"nsfw"; // Reset all pagination vars [rooms removeAllObjects]; nextBatch = nil; - _roomsCount = 0; - _moreThanRoomsCount = NO; + _searchResultsCount = 0; + _searchResultsCountIsLimited = NO; _hasReachedPaginationEnd = NO; } @@ -264,14 +269,14 @@ static NSString *const kNSFWKeyword = @"nsfw"; if (!self->_searchPattern) { // When there is no search, we can use totalRoomCountEstimate returned by the server - self->_roomsCount = publicRoomsResponse.totalRoomCountEstimate; - self->_moreThanRoomsCount = NO; + self->_searchResultsCount = publicRoomsResponse.totalRoomCountEstimate; + self->_searchResultsCountIsLimited = NO; } else { // Else we can only display something like ">20 matching rooms" - self->_roomsCount = self->rooms.count; - self->_moreThanRoomsCount = publicRoomsResponse.nextBatch ? YES : NO; + self->_searchResultsCount = self->rooms.count; + self->_searchResultsCountIsLimited = publicRoomsResponse.nextBatch ? YES : NO; } // Detect pagination end From 265b6df4ece7dd7dc56165bb69fcf80f6e6bcba3 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 8 Jul 2021 12:17:42 +0100 Subject: [PATCH 40/72] Update CHANGES.rst. --- CHANGES.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.rst b/CHANGES.rst index 486c751b3..595e1a070 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,6 +12,7 @@ Changes to be released in next version * More fixes to Main.storyboard layout on iPhone 12 Pro Max (#4527) * Fix crash on Apple Silicon Macs. * Media Picker: Generate video thumbnails with the correct orientation (#4515). + * Directory List (pop-up one): Fix duplicate rooms being shown (#4537). ⚠️ API Changes * From 7063978364b381e6306b4318157b2bdafe13e5d3 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 8 Jul 2021 12:28:52 +0100 Subject: [PATCH 41/72] Fix documentation. --- .../PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.h b/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.h index 73a4f9ed2..750daac05 100644 --- a/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.h +++ b/Riot/Modules/PublicRoomList/DataSources/PublicRoomsDirectoryDataSource.h @@ -68,7 +68,7 @@ /** The total number of public rooms matching `searchPattern`. - It is accurate only if 'moreThanRoomsCount' is NO. + It is accurate only if 'searchResultsCountIsLimited' is NO. */ @property (nonatomic, readonly) NSUInteger searchResultsCount; From f53445dc246907e5cbc9506782c652a4bd27fe0a Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 8 Jul 2021 16:26:19 +0100 Subject: [PATCH 42/72] Use AVAsset instead of NSURL to enable sending slow motion videos. Slow motion videos are returned as AVComposition objects when picked. which lacks a URL property. --- .../MediaPicker/MediaPickerCoordinator.swift | 4 +- ...ediaPickerCoordinatorBridgePresenter.swift | 6 +-- .../MediaPickerCoordinatorType.swift | 2 +- .../MediaPicker/MediaPickerViewController.h | 4 +- .../MediaPicker/MediaPickerViewController.m | 39 +++++++------------ .../SingleImagePickerPresenter.swift | 2 +- Riot/Modules/Room/RoomViewController.m | 4 +- 7 files changed, 26 insertions(+), 35 deletions(-) diff --git a/Riot/Modules/MediaPicker/MediaPickerCoordinator.swift b/Riot/Modules/MediaPicker/MediaPickerCoordinator.swift index d3b9c2c0d..61586be8d 100644 --- a/Riot/Modules/MediaPicker/MediaPickerCoordinator.swift +++ b/Riot/Modules/MediaPicker/MediaPickerCoordinator.swift @@ -83,8 +83,8 @@ extension MediaPickerCoordinator: MediaPickerViewControllerDelegate { self.delegate?.mediaPickerCoordinator(self, didSelectImageData: imageData, withUTI: uti) } - func mediaPickerController(_ mediaPickerController: MediaPickerViewController!, didSelectVideo videoURL: URL!) { - self.delegate?.mediaPickerCoordinator(self, didSelectVideoAt: videoURL) + func mediaPickerController(_ mediaPickerController: MediaPickerViewController!, didSelectVideo videoAsset: AVAsset!) { + self.delegate?.mediaPickerCoordinator(self, didSelectVideo: videoAsset) } func mediaPickerController(_ mediaPickerController: MediaPickerViewController!, didSelect assets: [PHAsset]!) { diff --git a/Riot/Modules/MediaPicker/MediaPickerCoordinatorBridgePresenter.swift b/Riot/Modules/MediaPicker/MediaPickerCoordinatorBridgePresenter.swift index 0ba21d893..782662ea9 100644 --- a/Riot/Modules/MediaPicker/MediaPickerCoordinatorBridgePresenter.swift +++ b/Riot/Modules/MediaPicker/MediaPickerCoordinatorBridgePresenter.swift @@ -20,7 +20,7 @@ import Foundation @objc protocol MediaPickerCoordinatorBridgePresenterDelegate { func mediaPickerCoordinatorBridgePresenter(_ coordinatorBridgePresenter: MediaPickerCoordinatorBridgePresenter, didSelectImageData imageData: Data, withUTI uti: MXKUTI?) - func mediaPickerCoordinatorBridgePresenter(_ coordinatorBridgePresenter: MediaPickerCoordinatorBridgePresenter, didSelectVideoAt url: URL) + func mediaPickerCoordinatorBridgePresenter(_ coordinatorBridgePresenter: MediaPickerCoordinatorBridgePresenter, didSelectVideo videoAsset: AVAsset) func mediaPickerCoordinatorBridgePresenter(_ coordinatorBridgePresenter: MediaPickerCoordinatorBridgePresenter, didSelectAssets assets: [PHAsset]) func mediaPickerCoordinatorBridgePresenterDidCancel(_ coordinatorBridgePresenter: MediaPickerCoordinatorBridgePresenter) } @@ -110,8 +110,8 @@ extension MediaPickerCoordinatorBridgePresenter: MediaPickerCoordinatorDelegate self.delegate?.mediaPickerCoordinatorBridgePresenter(self, didSelectImageData: imageData, withUTI: uti) } - func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectVideoAt url: URL) { - self.delegate?.mediaPickerCoordinatorBridgePresenter(self, didSelectVideoAt: url) + func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectVideo videoAsset: AVAsset) { + self.delegate?.mediaPickerCoordinatorBridgePresenter(self, didSelectVideo: videoAsset) } func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectAssets assets: [PHAsset]) { diff --git a/Riot/Modules/MediaPicker/MediaPickerCoordinatorType.swift b/Riot/Modules/MediaPicker/MediaPickerCoordinatorType.swift index 53f154536..9d91bdadc 100644 --- a/Riot/Modules/MediaPicker/MediaPickerCoordinatorType.swift +++ b/Riot/Modules/MediaPicker/MediaPickerCoordinatorType.swift @@ -20,7 +20,7 @@ import Foundation protocol MediaPickerCoordinatorDelegate: class { func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectImageData imageData: Data, withUTI uti: MXKUTI?) - func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectVideoAt url: URL) + func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectVideo videoAsset: AVAsset) func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectAssets assets: [PHAsset]) func mediaPickerCoordinatorDidCancel(_ coordinator: MediaPickerCoordinatorType) } diff --git a/Riot/Modules/MediaPicker/MediaPickerViewController.h b/Riot/Modules/MediaPicker/MediaPickerViewController.h index 99e9365fe..71487e1ea 100644 --- a/Riot/Modules/MediaPicker/MediaPickerViewController.h +++ b/Riot/Modules/MediaPicker/MediaPickerViewController.h @@ -39,9 +39,9 @@ Tells the delegate that the user select a video. @param mediaPickerController the `MediaPickerViewController` instance. - @param videoURL the local url of the video to send. + @param videoAsset an `AVAsset` that represents the video to send. */ -- (void)mediaPickerController:(MediaPickerViewController *)mediaPickerController didSelectVideo:(NSURL*)videoURL; +- (void)mediaPickerController:(MediaPickerViewController *)mediaPickerController didSelectVideo:(AVAsset*)videoAsset; /** Tells the delegate that the user wants to cancel media picking. diff --git a/Riot/Modules/MediaPicker/MediaPickerViewController.m b/Riot/Modules/MediaPicker/MediaPickerViewController.m index d08e6ab17..e34617241 100644 --- a/Riot/Modules/MediaPicker/MediaPickerViewController.m +++ b/Riot/Modules/MediaPicker/MediaPickerViewController.m @@ -608,28 +608,19 @@ if (asset) { - if ([asset isKindOfClass:[AVURLAsset class]]) - { - MXLogDebug(@"[MediaPickerVC] didSelectAsset: Got AVAsset for video"); - AVURLAsset *avURLAsset = (AVURLAsset*)asset; + MXLogDebug(@"[MediaPickerVC] didSelectAsset: Got AVAsset for video"); + + // Validate first the selected video + [self validateSelectedVideo:asset responseHandler:^(BOOL isValidated) { + + if (isValidated) + { + [self.delegate mediaPickerController:self didSelectVideo:asset]; + } - // Validate first the selected video - [self validateSelectedVideo:[avURLAsset URL] responseHandler:^(BOOL isValidated) { - - if (isValidated) - { - [self.delegate mediaPickerController:self didSelectVideo:[avURLAsset URL]]; - } - - self->isValidationInProgress = NO; - - }]; - } - else - { - MXLogDebug(@"[MediaPickerVC] Selected video asset is not initialized from an URL!"); self->isValidationInProgress = NO; - } + + }]; } else { @@ -693,7 +684,7 @@ [self setNeedsStatusBarAppearanceUpdate]; } -- (void)validateSelectedVideo:(NSURL*)selectedVideoURL responseHandler:(void (^)(BOOL isValidated))handler +- (void)validateSelectedVideo:(AVAsset*)selectedVideo responseHandler:(void (^)(BOOL isValidated))handler { [self dismissImageValidationView]; @@ -727,15 +718,15 @@ videoPlayer = [[AVPlayerViewController alloc] init]; if (videoPlayer) { + AVPlayerItem *item = [AVPlayerItem playerItemWithAsset:selectedVideo]; videoPlayer.allowsPictureInPicturePlayback = NO; videoPlayer.updatesNowPlayingInfoCenter = NO; - videoPlayer.player = [AVPlayer playerWithURL:selectedVideoURL]; + videoPlayer.player = [AVPlayer playerWithPlayerItem:item]; videoPlayer.videoGravity = AVLayerVideoGravityResizeAspect; videoPlayer.showsPlaybackControls = NO; // create a thumbnail for the first frame - AVAsset *asset = [AVAsset assetWithURL:selectedVideoURL]; - AVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset]; + AVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:selectedVideo]; generator.appliesPreferredTrackTransform = YES; CGImageRef thumbnailRef = [generator copyCGImageAtTime:kCMTimeZero actualTime:nil error:nil]; diff --git a/Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift b/Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift index f8bc066ee..56f501fdd 100644 --- a/Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift +++ b/Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift @@ -135,7 +135,7 @@ extension SingleImagePickerPresenter: MediaPickerCoordinatorBridgePresenterDeleg self.delegate?.singleImagePickerPresenter(self, didSelectImageData: imageData, withUTI: uti) } - func mediaPickerCoordinatorBridgePresenter(_ coordinatorBridgePresenter: MediaPickerCoordinatorBridgePresenter, didSelectVideoAt url: URL) { + func mediaPickerCoordinatorBridgePresenter(_ coordinatorBridgePresenter: MediaPickerCoordinatorBridgePresenter, didSelectVideo videoAsset: AVAsset) { self.delegate?.singleImagePickerPresenterDidCancel(self) } diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index fb4b7db8f..327704b47 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -6080,7 +6080,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; } } -- (void)mediaPickerCoordinatorBridgePresenter:(MediaPickerCoordinatorBridgePresenter *)coordinatorBridgePresenter didSelectVideoAt:(NSURL *)url +- (void)mediaPickerCoordinatorBridgePresenter:(MediaPickerCoordinatorBridgePresenter *)coordinatorBridgePresenter didSelectVideo:(AVAsset *)videoAsset { [coordinatorBridgePresenter dismissWithAnimated:YES completion:nil]; self.mediaPickerPresenter = nil; @@ -6088,7 +6088,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; RoomInputToolbarView *roomInputToolbarView = [self inputToolbarViewAsRoomInputToolbarView]; if (roomInputToolbarView) { - [roomInputToolbarView sendSelectedVideo:url isPhotoLibraryAsset:YES]; + [roomInputToolbarView sendSelectedVideo:videoAsset isPhotoLibraryAsset:YES]; } } From d49e741ab782b552390e1ea72d5dae71c1f6bbf5 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 8 Jul 2021 16:55:32 +0100 Subject: [PATCH 43/72] Send videos from the camera as AVURLAsset objects. --- Riot/Modules/Room/RoomViewController.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 327704b47..03f224687 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -6056,7 +6056,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; RoomInputToolbarView *roomInputToolbarView = [self inputToolbarViewAsRoomInputToolbarView]; if (roomInputToolbarView) { - [roomInputToolbarView sendSelectedVideo:url isPhotoLibraryAsset:NO]; + AVURLAsset *selectedVideo = [AVURLAsset assetWithURL:url]; + [roomInputToolbarView sendSelectedVideo:selectedVideo isPhotoLibraryAsset:NO]; } } From 3076c5f7821eb13b3eb94cf2ddf22b069204ea0f Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 8 Jul 2021 17:16:54 +0100 Subject: [PATCH 44/72] Fix sending videos from the share extension. --- RiotShareExtension/Managers/ShareExtensionManager.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RiotShareExtension/Managers/ShareExtensionManager.m b/RiotShareExtension/Managers/ShareExtensionManager.m index 47dfb03c4..189a224d4 100644 --- a/RiotShareExtension/Managers/ShareExtensionManager.m +++ b/RiotShareExtension/Managers/ShareExtensionManager.m @@ -1174,7 +1174,7 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) UIImage *videoThumbnail = [[UIImage alloc] initWithCGImage:imageRef]; CFRelease(imageRef); - [room sendVideo:videoLocalUrl withThumbnail:videoThumbnail localEcho:nil success:^(NSString *eventId) { + [room sendVideo:urlAsset withThumbnail:videoThumbnail localEcho:nil success:^(NSString *eventId) { if (successBlock) { successBlock(); From 1ca51de204d26b9bb405563af2d7b242d38f03aa Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 8 Jul 2021 17:41:55 +0100 Subject: [PATCH 45/72] Fix sending a video selected from a document picker. --- Riot/Modules/Room/DataSources/RoomDataSource.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Riot/Modules/Room/DataSources/RoomDataSource.m b/Riot/Modules/Room/DataSources/RoomDataSource.m index 831f96634..8cd789153 100644 --- a/Riot/Modules/Room/DataSources/RoomDataSource.m +++ b/Riot/Modules/Room/DataSources/RoomDataSource.m @@ -887,8 +887,10 @@ const CGFloat kTypingCellHeight = 24; success:(void (^)(NSString *eventId))success failure:(void (^)(NSError *error))failure { + AVURLAsset *videoAsset = [AVURLAsset assetWithURL:videoLocalURL]; UIImage *videoThumbnail = [MXKVideoThumbnailGenerator.shared generateThumbnailFrom:videoLocalURL]; - [self sendVideo:videoLocalURL withThumbnail:videoThumbnail success:success failure:failure]; + + [self sendVideo:videoAsset withThumbnail:videoThumbnail success:success failure:failure]; } - (void)acceptVerificationRequestForEventId:(NSString*)eventId success:(void(^)(void))success failure:(void(^)(NSError*))failure From 33ddec46d2a255ef272d6cfe5d209920cd9ffd03 Mon Sep 17 00:00:00 2001 From: langleyd Date: Thu, 8 Jul 2021 20:54:32 +0100 Subject: [PATCH 46/72] Fix logging, add "Notify me for" label, fix theme on avatar and add changes --- CHANGES.rst | 2 +- Riot/Assets/en.lproj/Vector.strings | 1 + Riot/Generated/Strings.swift | 4 ++ .../SectionHeaders/TitleHeaderView.swift | 39 +++++++++++++++++++ .../Common/SectionHeaders/TitleHeaderView.xib | 39 +++++++++++++++++++ .../RoomNotificationSettingsAvatarView.swift | 10 ++++- ...omNotificationSettingsViewController.swift | 27 ++++++++----- .../RoomNotificationsSettingsCell.swift | 2 + .../RoomNotificationsSettingsService.swift | 2 +- 9 files changed, 114 insertions(+), 12 deletions(-) create mode 100644 Riot/Modules/Common/SectionHeaders/TitleHeaderView.swift create mode 100644 Riot/Modules/Common/SectionHeaders/TitleHeaderView.xib diff --git a/CHANGES.rst b/CHANGES.rst index 486c751b3..1f76bc4dc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ Changes to be released in next version * 🙌 Improvements - * + * Room Norification Settings: Ability to change between "All Messages", "Mentions and Keywords" and "None". Not yet exposed in Element UI. (#4458). 🐛 Bugfix * VoIP: Do not present ended calls. diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index ab0cccfab..807d7069d 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -774,6 +774,7 @@ Tap the + to start adding people."; "room_details_copy_room_url" = "Copy Room URL"; // Room Notification Settings +"room_notifs_settings_notify_me_for" = "Notify me for"; "room_notifs_settings_all_messages" = "All Messages"; "room_notifs_settings_mentions_and_keywords" = "Mentions and Keywords only"; "room_notifs_settings_none" = "None"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index e192f4340..f42dc4450 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -3054,6 +3054,10 @@ internal enum VectorL10n { internal static var roomNotifsSettingsNone: String { return VectorL10n.tr("Vector", "room_notifs_settings_none") } + /// Notify me for + internal static var roomNotifsSettingsNotifyMeFor: String { + return VectorL10n.tr("Vector", "room_notifs_settings_notify_me_for") + } /// Connectivity to the server has been lost. internal static var roomOfflineNotification: String { return VectorL10n.tr("Vector", "room_offline_notification") diff --git a/Riot/Modules/Common/SectionHeaders/TitleHeaderView.swift b/Riot/Modules/Common/SectionHeaders/TitleHeaderView.swift new file mode 100644 index 000000000..a26d99820 --- /dev/null +++ b/Riot/Modules/Common/SectionHeaders/TitleHeaderView.swift @@ -0,0 +1,39 @@ +// +// 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. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +import Foundation +import Reusable + +class TitleHeaderView: UITableViewHeaderFooterView { + + @IBOutlet weak var label: UILabel! + + func update(title: String) { + label.text = title.uppercased() + } + +} + + +extension TitleHeaderView: NibReusable {} +extension TitleHeaderView: Themable { + + func update(theme: Theme) { + contentView.backgroundColor = theme.headerBackgroundColor + label.textColor = theme.headerTextSecondaryColor + label.font = theme.fonts.body + } +} diff --git a/Riot/Modules/Common/SectionHeaders/TitleHeaderView.xib b/Riot/Modules/Common/SectionHeaders/TitleHeaderView.xib new file mode 100644 index 000000000..c49ab7fff --- /dev/null +++ b/Riot/Modules/Common/SectionHeaders/TitleHeaderView.xib @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift index 39fe4dbec..c9bf9af89 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsAvatarView.swift @@ -17,7 +17,7 @@ import Foundation import Reusable -class RoomNotificationSettingsAvatarView: UIView, NibLoadable { +class RoomNotificationSettingsAvatarView: UIView { @IBOutlet weak var avatarView: MXKImageView! @IBOutlet weak var nameLabel: UILabel! @@ -41,3 +41,11 @@ class RoomNotificationSettingsAvatarView: UIView, NibLoadable { nameLabel.text = viewData.displayName } } + +extension RoomNotificationSettingsAvatarView: NibLoadable { } +extension RoomNotificationSettingsAvatarView: Themable { + func update(theme: Theme) { + nameLabel?.font = theme.fonts.title3SB + nameLabel?.textColor = theme.textPrimaryColor + } +} diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift index 21eb3e6e3..3e2adf89e 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationSettingsViewController.swift @@ -46,6 +46,7 @@ final class RoomNotificationSettingsViewController: UIViewController { } private struct Section { + var title: String var rows: [Row] var footerState: RoomNotificationSettingsFooter.State } @@ -128,8 +129,11 @@ final class RoomNotificationSettingsViewController: UIViewController { navigationItem.rightBarButtonItem = doneBarButtonItem mainTableView.register(cellType: RoomNotificationSettingsCell.self) mainTableView.register(headerFooterViewType: RoomNotificationSettingsFooter.self) + mainTableView.register(headerFooterViewType: TitleHeaderView.self) mainTableView.sectionFooterHeight = UITableView.automaticDimension + mainTableView.sectionHeaderHeight = UITableView.automaticDimension mainTableView.estimatedSectionFooterHeight = 50 + mainTableView.estimatedSectionHeaderHeight = 30 } private func render(viewState: RoomNotificationSettingsViewStateType) { @@ -143,6 +147,7 @@ final class RoomNotificationSettingsViewController: UIViewController { if let avatarData = viewState.avatarData { mainTableView.tableHeaderView = avatarView avatarView.configure(viewData: avatarData) + avatarView.update(theme: theme) } updateSections() } @@ -156,7 +161,7 @@ final class RoomNotificationSettingsViewController: UIViewController { }) }) let footerState = RoomNotificationSettingsFooter.State(showEncryptedNotice: viewState.roomEncrypted, showAccountLink: false) - let section0 = Section(rows: rows, footerState: footerState) + let section0 = Section(title: VectorL10n.roomNotifsSettingsNotifyMeFor, rows: rows, footerState: footerState) sections = [ section0 ] @@ -181,9 +186,12 @@ extension RoomNotificationSettingsViewController: UITableViewDataSource { cell.update(theme: theme) return cell } + + func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { + return UITableView.automaticDimension + } func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat { - return UITableView.automaticDimension } @@ -192,14 +200,15 @@ extension RoomNotificationSettingsViewController: UITableViewDataSource { // MARK: - UITableViewDelegate extension RoomNotificationSettingsViewController: UITableViewDelegate { - func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { - cell.backgroundColor = theme.backgroundColor - cell.selectedBackgroundView = UIView() - cell.selectedBackgroundView?.backgroundColor = theme.selectedBackgroundColor + func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { + guard let headerView: TitleHeaderView = tableView.dequeueReusableHeaderFooterView() else { return nil } + headerView.update(title: sections[section].title) + headerView.update(theme: theme) + return headerView } - + func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { - guard let footerView: RoomNotificationSettingsFooter = tableView.dequeueReusableHeaderFooterView() else { return nil } + guard let footerView: RoomNotificationSettingsFooter = tableView.dequeueReusableHeaderFooterView() else { return nil } let footerState = sections[section].footerState footerView.update(footerState: footerState) footerView.update(theme: theme) @@ -212,7 +221,7 @@ extension RoomNotificationSettingsViewController: UITableViewDelegate { let row = sections[indexPath.section].rows[indexPath.row] row.action?() } - + } // MARK: - RoomNotificationSettingsViewModelViewDelegate diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift index 3d4bec1f7..343c7bba4 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsCell.swift @@ -37,6 +37,8 @@ extension RoomNotificationSettingsCell: Themable { backgroundColor = theme.backgroundColor contentView.backgroundColor = .clear tintColor = theme.tintColor + selectedBackgroundView = UIView() + selectedBackgroundView?.backgroundColor = theme.selectedBackgroundColor } } diff --git a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsService.swift b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsService.swift index bb7e2fe81..1bd0e4b6b 100644 --- a/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsService.swift +++ b/Riot/Modules/Room/NotificationSettings/RoomNotificationsSettingsService.swift @@ -93,7 +93,7 @@ final class RoomNotificationSettingsService: RoomNotificationSettingsServiceType } guard notificationCenterDidUpdateObserver == nil else { - MXLog.debug("[MXRoom+Riot] Request in progress: ignore push rule update") + MXLog.debug("[RoomNotificationSettingsService] Request in progress: ignore push rule update") completion() return } From e3c90d73708d9f10f073f80a3a419ed9a8546ffd Mon Sep 17 00:00:00 2001 From: langleyd Date: Fri, 9 Jul 2021 09:08:42 +0100 Subject: [PATCH 47/72] Update template copyright date --- .../FlowCoordinatorTemplate/FlowTemplateCoordinator.swift | 2 +- .../FlowTemplateCoordinatorBridgePresenter.swift | 2 +- .../FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift | 2 +- .../buildable/ScreenTemplate/TemplateScreenCoordinator.swift | 2 +- .../ScreenTemplate/TemplateScreenCoordinatorType.swift | 2 +- .../buildable/ScreenTemplate/TemplateScreenViewAction.swift | 2 +- .../buildable/ScreenTemplate/TemplateScreenViewController.swift | 2 +- .../buildable/ScreenTemplate/TemplateScreenViewModel.swift | 2 +- .../buildable/ScreenTemplate/TemplateScreenViewModelType.swift | 2 +- .../buildable/ScreenTemplate/TemplateScreenViewState.swift | 2 +- .../SimpleScreenTemplateViewController.swift | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinator.swift b/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinator.swift index a211ab040..2f51aa2c2 100644 --- a/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinator.swift +++ b/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinator.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorBridgePresenter.swift b/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorBridgePresenter.swift index bb7f824e4..25024f94d 100644 --- a/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorBridgePresenter.swift +++ b/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorBridgePresenter.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift b/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift index 4fa5cc5dc..057328e71 100644 --- a/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift +++ b/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinator.swift b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinator.swift index 78ebc30f8..276fff2a8 100644 --- a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinator.swift +++ b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinator.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinatorType.swift b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinatorType.swift index 745997b9c..8b390ac60 100644 --- a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinatorType.swift +++ b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinatorType.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewAction.swift b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewAction.swift index 0bfc0f7f2..fc25efd98 100644 --- a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewAction.swift +++ b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewAction.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewController.swift b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewController.swift index f3a30d180..78175a877 100644 --- a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewController.swift +++ b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewController.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModel.swift b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModel.swift index 05c07ba58..4c386a8f7 100644 --- a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModel.swift +++ b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModel.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModelType.swift b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModelType.swift index fd03254da..19e3af58c 100644 --- a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModelType.swift +++ b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModelType.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewState.swift b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewState.swift index cc347baaa..4cebae662 100644 --- a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewState.swift +++ b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewState.swift @@ -1,5 +1,5 @@ /* - 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. diff --git a/Tools/Templates/buildable/SimpleScreenTemplate/SimpleScreenTemplateViewController.swift b/Tools/Templates/buildable/SimpleScreenTemplate/SimpleScreenTemplateViewController.swift index 2955714c9..b4c86a60b 100644 --- a/Tools/Templates/buildable/SimpleScreenTemplate/SimpleScreenTemplateViewController.swift +++ b/Tools/Templates/buildable/SimpleScreenTemplate/SimpleScreenTemplateViewController.swift @@ -1,5 +1,5 @@ /* - 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. From e0d1641921b0b306e1870dcfda09a82507bcd71e Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 9 Jul 2021 10:26:02 +0100 Subject: [PATCH 48/72] Update to use sendVideoAsset: on MXRoom. --- RiotShareExtension/Managers/ShareExtensionManager.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RiotShareExtension/Managers/ShareExtensionManager.m b/RiotShareExtension/Managers/ShareExtensionManager.m index 189a224d4..5b69743be 100644 --- a/RiotShareExtension/Managers/ShareExtensionManager.m +++ b/RiotShareExtension/Managers/ShareExtensionManager.m @@ -1165,8 +1165,8 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) } // Retrieve the video frame at 1 sec to define the video thumbnail - AVURLAsset *urlAsset = [[AVURLAsset alloc] initWithURL:videoLocalUrl options:nil]; - AVAssetImageGenerator *assetImageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:urlAsset]; + AVURLAsset *videoAsset = [[AVURLAsset alloc] initWithURL:videoLocalUrl options:nil]; + AVAssetImageGenerator *assetImageGenerator = [AVAssetImageGenerator assetImageGeneratorWithAsset:videoAsset]; assetImageGenerator.appliesPreferredTrackTransform = YES; CMTime time = CMTimeMake(1, 1); CGImageRef imageRef = [assetImageGenerator copyCGImageAtTime:time actualTime:NULL error:nil]; @@ -1174,7 +1174,7 @@ typedef NS_ENUM(NSInteger, ImageCompressionMode) UIImage *videoThumbnail = [[UIImage alloc] initWithCGImage:imageRef]; CFRelease(imageRef); - [room sendVideo:urlAsset withThumbnail:videoThumbnail localEcho:nil success:^(NSString *eventId) { + [room sendVideoAsset:videoAsset withThumbnail:videoThumbnail localEcho:nil success:^(NSString *eventId) { if (successBlock) { successBlock(); From cb81c905bca3cdd54d30cc4655fcb6b2e35f7df5 Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 9 Jul 2021 11:04:00 +0100 Subject: [PATCH 49/72] Update CHANGES.rst. --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 486c751b3..803bdea12 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ Changes to be released in next version * 🙌 Improvements - * + * Add support for sending slow motion videos (#4483). 🐛 Bugfix * VoIP: Do not present ended calls. From e13230992de980f9bad7c2c175847c02dd037c35 Mon Sep 17 00:00:00 2001 From: HelaBasa Date: Thu, 8 Jul 2021 03:34:48 +0000 Subject: [PATCH 50/72] Translated using Weblate (Sinhala) Currently translated at 17.1% (6 of 35 strings) Translation: Element iOS/Element iOS (Push) Translate-URL: https://translate.element.io/projects/riot-ios/riot-ios-push/si/ --- Riot/Assets/si.lproj/Localizable.strings | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Riot/Assets/si.lproj/Localizable.strings b/Riot/Assets/si.lproj/Localizable.strings index 432026982..ac8956825 100644 --- a/Riot/Assets/si.lproj/Localizable.strings +++ b/Riot/Assets/si.lproj/Localizable.strings @@ -17,3 +17,6 @@ /* New message from a specific person, not referencing a room. Content included. */ "MSG_FROM_USER_WITH_CONTENT" = "%@: %@"; + +/* Group call from user, CallKit caller name */ +"GROUP_CALL_FROM_USER" = "%@ (සමූහ ඇමතුම)"; From 3aac4af63d86daa05bf2b0c896e49d5f74d95f83 Mon Sep 17 00:00:00 2001 From: Deleted User Date: Thu, 8 Jul 2021 13:16:07 +0000 Subject: [PATCH 51/72] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 100.0% (35 of 35 strings) Translation: Element iOS/Element iOS (Push) Translate-URL: https://translate.element.io/projects/riot-ios/riot-ios-push/nb_NO/ --- Riot/Assets/nb-NO.lproj/Localizable.strings | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Riot/Assets/nb-NO.lproj/Localizable.strings b/Riot/Assets/nb-NO.lproj/Localizable.strings index 26102b751..5f6a77573 100644 --- a/Riot/Assets/nb-NO.lproj/Localizable.strings +++ b/Riot/Assets/nb-NO.lproj/Localizable.strings @@ -111,3 +111,9 @@ "MSG_FROM_USER" = "%@ sendte en melding"; /* Message title for a specific person in a named room */ "MSG_FROM_USER_IN_ROOM_TITLE" = "%@ i %@"; + +/* Group call from user, CallKit caller name */ +"GROUP_CALL_FROM_USER" = "%@ (Gruppeanrop)"; + +/* A user added a Jitsi call to a room */ +"GROUP_CALL_STARTED" = "Gruppeanrop startet"; From 07036389b3146bc5ec7e0dc4cdd180394743e13d Mon Sep 17 00:00:00 2001 From: Deleted User Date: Thu, 8 Jul 2021 13:36:27 +0000 Subject: [PATCH 52/72] =?UTF-8?q?Translated=20using=20Weblate=20(Norwegian?= =?UTF-8?q?=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 97.7% (1205 of 1233 strings) Translation: Element iOS/Element iOS Translate-URL: https://translate.element.io/projects/riot-ios/riot-ios/nb_NO/ --- Riot/Assets/nb-NO.lproj/Vector.strings | 89 ++++++++++++++++++++------ 1 file changed, 68 insertions(+), 21 deletions(-) diff --git a/Riot/Assets/nb-NO.lproj/Vector.strings b/Riot/Assets/nb-NO.lproj/Vector.strings index c47bf5f51..74f8d9e00 100644 --- a/Riot/Assets/nb-NO.lproj/Vector.strings +++ b/Riot/Assets/nb-NO.lproj/Vector.strings @@ -479,7 +479,7 @@ "settings_discovery_error_message" = "Det oppstod en feil. Vennligst prøv igjen."; "security_settings_crypto_sessions" = "MINE ØKTER"; "security_settings_secure_backup_setup" = "Sett opp"; -"security_settings_secure_backup_delete" = "Slett"; +"security_settings_secure_backup_delete" = "Slett sikkerhetskopi"; "security_settings_crosssigning_complete_security" = "Komplett sikkerhet"; "security_settings_cryptography" = "KRYPTOGRAFI"; "security_settings_complete_security_alert_title" = "Komplett sikkerhet"; @@ -513,7 +513,7 @@ "key_backup_setup_passphrase_confirm_passphrase_placeholder" = "Bekreft passordfrasen"; "key_backup_setup_passphrase_confirm_passphrase_invalid" = "Passordfrasen samsvarer ikke"; "key_backup_setup_passphrase_set_passphrase_action" = "Velg passordfrase"; -"key_backup_setup_success_from_recovery_key_recovery_key_title" = "Gjenopprettingsnøkkel"; +"key_backup_setup_success_from_recovery_key_recovery_key_title" = "Sikkerhetsnøkkel"; "key_backup_setup_success_from_recovery_key_make_copy_action" = "Lag en kpi"; "key_backup_setup_success_from_recovery_key_made_copy_action" = "Jeg har laget en kopi"; "key_backup_recover_from_recovery_key_recovery_key_placeholder" = "Skriv inn gjenopprettingsnøkkelen"; @@ -834,7 +834,7 @@ "settings_key_backup_info_not_valid" = "Denne økten sikkerhetskopierer ikke dine nøkler, men du har en eksisterende sikkerhetskopi du kan gjenopprette fra og legge til, for å gå videre."; "settings_key_backup_info_valid" = "Denne økten sikkerhetskopierer dine nøkler."; "settings_key_backup_info_version" = "Sikkerhetskopi av nøkler versjon : %@"; -"settings_key_backup_info_signout_warning" = "Før du logger ut, koble denne sesjonen til sikkerhetskopi av nøkler for å unngå tap av nøkler som kanskje bare er lagret på denne enheten."; +"settings_key_backup_info_signout_warning" = "Sikkerhetskopier nøklene dine før du logger av for å unngå å miste dem."; "settings_key_backup_info_none" = "Nøklene dine for denne sesjonen blir ikke sikkerhetskopiert."; "settings_third_party_notices" = "Tredjepartsmerknader"; "settings_labs_e2e_encryption_prompt_message" = "Vennligst logg inn igjen for å ferdigstille oppsett av kryptering."; @@ -864,7 +864,7 @@ "pin_protection_not_allowed_pin" = "Av sikkerhetsårsaker er denne PIN-koden ikke tilgjengelig. Prøv en annen PIN-kode"; "secrets_setup_recovery_passphrase_information" = "Skriv inn en sikkerhetsfrase bare du kjenner, brukes til å sikre hemmeligheter på serveren."; "secrets_recovery_with_passphrase_lost_passphrase_action_part2" = "bruke gjenopprettingsnøkkelen din"; -"key_backup_recover_from_passphrase_lost_passphrase_action_part2" = "bruke gjenopprettingsnøkkelen"; +"key_backup_recover_from_passphrase_lost_passphrase_action_part2" = "bruk sikkerhetsnøkkelen"; "room_details_access_section_for_dm" = "Hvem har tilgang til dette?"; "identity_server_settings_place_holder" = "Legg inn en identitetsserver"; "identity_server_settings_description" = "Du bruker for øyeblikket %@ for å finne og bli funnet av dine eksisterende kontakter."; @@ -920,13 +920,13 @@ "security_settings_crosssigning" = "KRYSS-SIGNERING"; "security_settings_backup" = "SIKKERHETSKOPI-MELDINGER"; "security_settings_secure_backup_synchronise" = "Synkroniser"; -"security_settings_secure_backup_description" = "Sikre deg mot å miste tilgang til krypterte meldinger og data ved å lagre sikkerhetskopi av krypteringsnøkler på din server."; +"security_settings_secure_backup_description" = "Sikkerhetskopier krypteringsnøklene med kontodataene dine hvis du mister tilgangen til øktene dine. Nøklene dine blir sikret med en unik sikkerhetsnøkkel."; "security_settings_secure_backup" = "SIKKERHETSKOPI"; "security_settings_crosssigning_info_trusted" = "Kryss-signering er aktivert. Du kan stole på andre brukere og dine andre økter basert på kryss-signering, men du kan ikke kryss-signere fra denne økten fordi den ikke har private nøkler for kryss-signering. Fullfør sikkerheten for denne økten."; "security_settings_export_keys_manually" = "Eksporter nøkler manuelt"; -"security_settings_crosssigning_reset" = "Tilbakestill kryss-signering"; -"security_settings_crosssigning_bootstrap" = "Bootstrap kryss-signering"; -"security_settings_crosssigning_info_ok" = "Kryss-signering er aktivert."; +"security_settings_crosssigning_reset" = "Nullstill"; +"security_settings_crosssigning_bootstrap" = "Sett opp"; +"security_settings_crosssigning_info_ok" = "Kryss-signering er klar til bruk."; "security_settings_blacklist_unverified_devices" = "Aldri send meldinger til ikke-klarerte økter"; // AuthenticatedSessionViewControllerFactory @@ -1052,7 +1052,7 @@ "bug_report_prompt" = "Applikasjonen krasjet sist gang. Vil du sende inn en krasj-rapport?"; "public_room_section_title" = "Offentlige rom (på %@):"; "call_no_stun_server_error_message_2" = "Alternativt kan du prøve å bruke den offentlige serveren ved %@, men denne vil være mindre pålitelig, og vil dele din IP-adresse med serveren. Du kan også administrere dette i innstillinger"; -"e2e_key_backup_wrong_version" = "Det har blitt oppdaget en ny sikkerhetskopi av meldingsnøkler .\n\nHvis dette ikke ble intitiert av deg bør du endre passordfrase i innstillinger."; +"e2e_key_backup_wrong_version" = "Det har blitt oppdaget en ny sikkerhetskopi av meldingsnøkler .\n\nHvis dette ikke var deg, angir du en ny sikkerhetsfrase i Innstillinger."; // Key backup wrong version "e2e_key_backup_wrong_version_title" = "Ny sikkerhetskopi av nøkler"; @@ -1136,7 +1136,7 @@ "secure_key_backup_setup_intro_title" = "Sikkert lagringsområde"; "secure_key_backup_setup_intro_use_security_key_info" = "Generer en sikkerhetsnøkkel og lagre den på et trygt sted som i en passordadministrator eller en safe."; "secure_key_backup_setup_intro_use_security_key_title" = "Bruk en sikkerhetsnøkkel"; -"secure_key_backup_setup_intro_use_security_passphrase_title" = "Bruk en passordfrase"; +"secure_key_backup_setup_intro_use_security_passphrase_title" = "Bruk en sikkerhetsfrase"; "key_backup_setup_intro_manual_export_action" = "Eksporter nøkler manuelt"; "key_backup_setup_intro_setup_connect_action_with_existing_backup" = "Koble denne enheten til sikkerhetskopi av meldingsnøkler"; "key_backup_setup_skip_alert_message" = "Du kan miste dine krypterte meldinger dersom du logger ut eller mister enheten."; @@ -1154,12 +1154,12 @@ "secure_key_backup_setup_existing_backup_error_info" = "Lås den opp for å gjenbruke den på sikkert lagringsområde, eller slett den for å opprette en ny sikkerhetskopi av meldinger på sikkert lagringsområde."; "secure_key_backup_setup_existing_backup_error_title" = "Det finnes allerede en sikkerhetskopi for meldinger"; "secure_key_backup_setup_intro_use_security_passphrase_info" = "Skriv inn en hemmelig frase bare du vet, og generer en nøkkel for sikkerhetskopiering."; -"key_backup_setup_passphrase_setup_recovery_key_info" = "Eller sikre sikkerhetskopien din med en gjenopprettingsnøkkel, og lagre den på et trygt sted."; -"key_backup_setup_passphrase_info" = "Vi lagrer en kryptert kopi av nøklene dine på serveren vår. Beskytt sikkerhetskopien din med en passordfrase for å holde den sikker.\n\nFor maksimal sikkerhet bør dette være forskjellig fra kontopassordet ditt."; +"key_backup_setup_passphrase_setup_recovery_key_info" = "Eller, sikre sikkerhetskopien med en sikkerhetsnøkkel, og lagre den et trygt sted."; +"key_backup_setup_passphrase_info" = "Vi lagrer en kryptert kopi av nøklene dine på serveren vår. Beskytt sikkerhetskopien med en setning for å holde den sikker.\n\nFor maksimal sikkerhet bør dette være forskjellig fra kontopassordet ditt."; // Passphrase -"key_backup_setup_passphrase_title" = "Gjør sikkerhetskopien din sikker med en passordfrase"; +"key_backup_setup_passphrase_title" = "Sikre sikkerhetskopien din med en sikkerhetsfrase"; "key_backup_setup_intro_info" = "Meldinger i krypterte rom er sikret med ende-til-ende-kryptering. Bare du og mottakeren(e) har nøklene til å lese disse meldingene.\n\nLagre nøklene dine på et trygt sted for å unngå å miste dem."; // MARK: Key backup recover @@ -1168,29 +1168,29 @@ // Success from recovery key "key_backup_setup_success_from_recovery_key_info" = "Nøklene dine blir sikkerhetskopiert.\n\nKopier denne gjenopprettingsnøkkelen og lagre den på et trygt sted."; -"key_backup_setup_success_from_passphrase_save_recovery_key_action" = "Lagre gjenopprettingsnøkkel"; +"key_backup_setup_success_from_passphrase_save_recovery_key_action" = "Lagre sikkerhetsnøkkel"; // Success from passphrase "key_backup_setup_success_from_passphrase_info" = "Nøklene dine blir sikkerhetskopiert.\n\nGjenopprettingsnøkkelen din er et sikkerhetsnett - du kan bruke den til å gjenopprette tilgangen til de krypterte meldingene dine hvis du glemmer passordfrasen.\n\nLagre gjenopprettingsnøkkelen din på en trygg måte, f.eks. ved hjelp av en passordadministrator (eller i en safe)."; -"key_backup_setup_passphrase_setup_recovery_key_action" = "(Avansert) Sett opp med gjenopprettingsnøkkel"; -"key_backup_recover_invalid_passphrase" = "Sikkerhetskopi kunne ikke dekrypteres med denne passordfrasen: Vennligst sjekk at du har angitt riktig passordfrase."; -"key_backup_recover_invalid_passphrase_title" = "Feil gjenopprettingsfrase"; -"key_backup_recover_invalid_recovery_key" = "Sikkerhetskopi kunne ikke dekrypteres med denne nøkkelen: bekreft at du skrev inn riktig gjenopprettingsnøkkel."; +"key_backup_setup_passphrase_setup_recovery_key_action" = "(Avansert) Sett opp med sikkerhetsnøkkel"; +"key_backup_recover_invalid_passphrase" = "Sikkerhetskopiering kunne ikke dekrypteres med denne setningen: bekreft at du har skrevet riktig sikkerhetsfrase."; +"key_backup_recover_invalid_passphrase_title" = "Feil sikkerhetsfrase"; +"key_backup_recover_invalid_recovery_key" = "Sikkerhetskopiering kunne ikke dekrypteres med denne nøkkelen: bekreft at du har angitt riktig sikkerhetsnøkkel."; "key_backup_recover_invalid_recovery_key_title" = "Feil i gjenopprettingsnøkkel"; // Recover from passphrase -"key_backup_recover_from_passphrase_info" = "Bruk gjenopprettingspassordet for å låse opp historikken for dine sikrede meldinger"; +"key_backup_recover_from_passphrase_info" = "Bruk sikkerhetsfrasen for å låse opp den sikre meldingsloggen"; // Recover from private key "key_backup_recover_from_private_key_info" = "Gjenoppretter sikkerhetskopi …"; -"key_backup_recover_from_passphrase_lost_passphrase_action_part1" = "Kjenner du ikke gjenopprettingspassordet ditt? Du kan "; +"key_backup_recover_from_passphrase_lost_passphrase_action_part1" = "Kjenner du ikke sikkerhetsfrasen din? Du kan "; "key_backup_recover_from_passphrase_recover_action" = "Lås opp historikk"; "key_backup_recover_from_passphrase_passphrase_placeholder" = "Skriv inn passordfrase"; // Recover from recovery key -"key_backup_recover_from_recovery_key_info" = "Bruk gjenopprettingsnøkkel for å låse opp historikken for sikrede meldinger"; +"key_backup_recover_from_recovery_key_info" = "Bruk sikkerhetsnøkkelen til å låse opp den sikre meldingsloggen"; "key_backup_recover_from_passphrase_lost_passphrase_action_part3" = "."; "sign_out_non_existing_key_backup_alert_setup_secure_backup_action" = "Begynn å bruke Sikkert lagringsområde"; "sign_out_non_existing_key_backup_alert_title" = "Du mister tilgangen til de krypterte meldingene dine hvis du logger ut nå"; @@ -1418,3 +1418,50 @@ "room_intro_cell_information_multiple_dm_sentence2" = "Bare dere er i denne samtalen, med mindre noen av dere inviterer andre til å bli med."; "room_intro_cell_information_dm_sentence2" = "Bare dere to er i denne samtalen, ingen andre kan bli med."; "room_intro_cell_information_dm_sentence1_part3" = ". "; +"side_menu_app_version" = "Versjon %@"; +"side_menu_action_feedback" = "Tilbakemelding"; +"side_menu_action_help" = "Hjelp"; +"side_menu_action_settings" = "Innstillinger"; +"side_menu_action_invite_friends" = "Inviter venner"; + +// Mark: - Side menu + +"side_menu_reveal_action_accessibility_label" = "Venstre panel"; +"user_avatar_view_accessibility_hint" = "Endre bruker avatar"; + +// Mark: - User avatar view + +"user_avatar_view_accessibility_label" = "avatar"; +"space_beta_announce_information" = "Plasser er en ny måte å gruppere rom og mennesker på. De er ikke på iOS ennå, men du kan bruke dem nå på nettet og på skrivebordet."; +"space_beta_announce_subtitle" = "Den nye versjonen av lokalsamfunn"; +"space_beta_announce_title" = "Plasser kommer snart"; +"space_beta_announce_badge" = "BETA"; +"space_feature_unavailable_information" = "Plasser er en ny måte å gruppere rom og mennesker på.\n\nDe kommer snart. For nå, hvis du blir med på en annen plattform, vil du kunne få tilgang til alle rom du blir med her."; +"space_feature_unavailable_subtitle" = "Plasser er ikke på iOS ennå, men du kan bruke dem nå på nettet og på skrivebordet"; + +// Mark: - Spaces + +"space_feature_unavailable_title" = "Plasser er ikke her ennå"; +"secrets_recovery_with_key_information_unlock_secure_backup_with_key" = "Skriv inn sikkerhetsnøkkelen din for å fortsette."; +"secrets_recovery_with_key_information_unlock_secure_backup_with_phrase" = "Skriv inn sikkerhetsfrasen for å fortsette."; + +// Success from secure backup +"key_backup_setup_success_from_secure_backup_info" = "Nøklene dine blir sikkerhetskopiert."; +"event_formatter_group_call_incoming" = "%@ i %@"; +"event_formatter_group_call_leave" = "Forlat"; +"event_formatter_group_call_join" = "Bli med"; +"event_formatter_group_call" = "Gruppeanrop"; +"event_formatter_call_end_call" = "Avslutt samtale"; +"event_formatter_call_retry" = "Prøv på nytt"; +"event_formatter_call_answer" = "Svar"; +"security_settings_secure_backup_restore" = "Gjenopprett fra sikkerhetskopi"; +"security_settings_secure_backup_reset" = "Nullstill"; +"security_settings_secure_backup_info_valid" = "Denne økten tar sikkerhetskopi av nøklene dine."; +"security_settings_secure_backup_info_checking" = "Sjekker…"; +"settings_ui_theme_picker_message_match_system_theme" = "\"Auto\" samsvarer med enhetens systemtema"; +"settings_ui_theme_picker_message_invert_colours" = "\"Auto\" bruker enhetens \"Inverter farger\" innstillinger"; + +// Chat +"room_slide_to_end_group_call" = "Skyv for å avslutte samtalen for alle"; +"room_recents_unknown_room_error_message" = "Finner ikke dette rommet. Forsikre deg om at den eksisterer"; +"room_creation_dm_error" = "Vi kunne ikke opprette DM. Kontroller brukerne du vil invitere, og prøv på nytt."; From d0ebf701818259d38c82dcaf0ab556572c072652 Mon Sep 17 00:00:00 2001 From: HelaBasa Date: Thu, 8 Jul 2021 03:37:54 +0000 Subject: [PATCH 53/72] Translated using Weblate (Sinhala) Currently translated at 1.2% (15 of 1233 strings) Translation: Element iOS/Element iOS Translate-URL: https://translate.element.io/projects/riot-ios/riot-ios/si/ --- Riot/Assets/si.lproj/Vector.strings | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Riot/Assets/si.lproj/Vector.strings b/Riot/Assets/si.lproj/Vector.strings index 982e41a3b..59e0d02cf 100644 --- a/Riot/Assets/si.lproj/Vector.strings +++ b/Riot/Assets/si.lproj/Vector.strings @@ -1,3 +1,16 @@ // Titles "title_home" = "මුල් පිටුව"; "warning" = "අවවාදයයි"; +"join" = "එක්වන්න"; +"save" = "සුරකින්න"; +"cancel" = "අවලංගු කරන්න"; +"remove" = "ඉවත් කරන්න"; +"leave" = "හැරයන්න"; +"start" = "අරඹන්න"; +"create" = "සාදන්න"; +"continue" = "ඉදිරියට"; +"back" = "ආපසු"; +"next" = "ඊලඟ"; +"title_rooms" = "කාමර"; +"title_people" = "මිනිසුන්"; +"title_favourites" = "ප්‍රියතමයින්"; From 45f3a90a68cf9c8990d6a8a59eef2219d9606548 Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 9 Jul 2021 16:35:39 +0100 Subject: [PATCH 54/72] Remove conditional_binding_cascade rule. No longer supported in SwiftLint. --- .swiftlint.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 8682b5912..765c414b4 100755 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -2,7 +2,6 @@ disabled_rules: - trailing_whitespace - todo - - conditional_binding_cascade - mark - vertical_whitespace - syntactic_sugar From 5630a43757d98d42b1748e061e7f73da4e60a10b Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 9 Jul 2021 16:38:25 +0100 Subject: [PATCH 55/72] Don't show dialog on cancel if self-verifying The user should know they cancelled in if they're self verifying since they're the one who cancelled, from their other device (the copy referred to 'the other party', so was inaccurate, so we may as well just remove it). --- ...ficationVerifyByScanningViewController.swift | 17 +++++++++++++---- ...yVerificationVerifyByScanningViewModel.swift | 4 ++-- ...yVerificationVerifyByScanningViewState.swift | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift index cb8bc27f6..f9798806d 100644 --- a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift +++ b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift @@ -159,8 +159,8 @@ final class KeyVerificationVerifyByScanningViewController: UIViewController { self.render(error: error) case .scannedCodeValidated(let isValid): self.renderScannedCode(valid: isValid) - case .cancelled(let reason): - self.renderCancelled(reason: reason) + case .cancelled(let reason, let verificationKind): + self.renderCancelled(reason: reason, verificationKind: verificationKind) case .cancelledByMe(let reason): self.renderCancelledByMe(reason: reason) } @@ -236,12 +236,21 @@ final class KeyVerificationVerifyByScanningViewController: UIViewController { } } - private func renderCancelled(reason: MXTransactionCancelCode) { + private func renderCancelled(reason: MXTransactionCancelCode, + verificationKind: KeyVerificationKind) { self.activityPresenter.removeCurrentActivityIndicator(animated: true) self.stopQRCodeScanningIfPresented() - self.errorPresenter.presentError(from: self.alertPresentingViewController, title: "", message: VectorL10n.deviceVerificationCancelled, animated: true) { + // if we're verifying with someone else, let the user know threy cancelled. + // if we're verifying our own device, assume the user probably knows since it them who + // cancelled on their other device + if verificationKind == .user { + self.errorPresenter.presentError(from: self.alertPresentingViewController, title: "", message: VectorL10n.deviceVerificationCancelled, animated: true) { + self.dismissQRCodeScanningIfPresented(animated: false) + self.viewModel.process(viewAction: .cancel) + } + } else { self.dismissQRCodeScanningIfPresented(animated: false) self.viewModel.process(viewAction: .cancel) } diff --git a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewModel.swift b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewModel.swift index 706a121d9..de4b9e189 100644 --- a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewModel.swift +++ b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewModel.swift @@ -225,7 +225,7 @@ final class KeyVerificationVerifyByScanningViewModel: KeyVerificationVerifyBySca return } self.unregisterTransactionDidStateChangeNotification() - self.update(viewState: .cancelled(reason)) + self.update(viewState: .cancelled(cancelCode: reason, verificationKind: verificationKind)) case MXSASTransactionStateCancelledByMe: guard let reason = transaction.reasonCancelCode else { return @@ -251,7 +251,7 @@ final class KeyVerificationVerifyByScanningViewModel: KeyVerificationVerifyBySca return } self.unregisterTransactionDidStateChangeNotification() - self.update(viewState: .cancelled(reason)) + self.update(viewState: .cancelled(cancelCode: reason, verificationKind: verificationKind)) case .cancelledByMe: guard let reason = transaction.reasonCancelCode else { return diff --git a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewState.swift b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewState.swift index b6323eb70..e3ecc8238 100644 --- a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewState.swift +++ b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewState.swift @@ -29,7 +29,7 @@ enum KeyVerificationVerifyByScanningViewState { case loading case loaded(viewData: KeyVerificationVerifyByScanningViewData) case scannedCodeValidated(isValid: Bool) - case cancelled(MXTransactionCancelCode) + case cancelled(cancelCode: MXTransactionCancelCode, verificationKind: KeyVerificationKind) case cancelledByMe(MXTransactionCancelCode) case error(Error) } From c411097256f2ffe4f4822e9cf8c7707583f0d661 Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 9 Jul 2021 17:05:43 +0100 Subject: [PATCH 56/72] Fix class keyword deprecation warnings everywhere! Using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead --- Riot/Coordinators/Coordinator.swift | 2 +- Riot/Managers/Call/CallPresenterDelegate.swift | 2 +- Riot/Managers/Call/PiPView.swift | 2 +- Riot/Managers/Theme/Themable.swift | 2 +- .../Authentication/SocialLogin/SocialLoginListView.swift | 2 +- Riot/Modules/Call/Dialpad/DialpadViewController.swift | 2 +- .../Modules/CallTransfer/CallTransferMainViewController.swift | 2 +- .../CallTransferSelectContactViewController.swift | 2 +- Riot/Modules/Camera/CameraPresenter.swift | 2 +- Riot/Modules/CreateRoom/CreateRoomCoordinatorType.swift | 2 +- .../EnterNewRoomDetails/Cells/ChooseAvatarTableViewCell.swift | 2 +- .../EnterNewRoomDetailsCoordinatorType.swift | 2 +- .../EnterNewRoomDetailsViewModelType.swift | 4 ++-- .../CrossSigning/Banners/CrossSigningSetupBannerCell.swift | 2 +- .../CrossSigning/Setup/CrossSigningSetupCoordinatorType.swift | 2 +- Riot/Modules/GDPR/GDPRConsentViewController.swift | 2 +- .../KeyBackup/Recover/KeyBackupRecoverCoordinatorType.swift | 2 +- .../KeyBackupRecoverFromPassphraseCoordinatorType.swift | 2 +- .../KeyBackupRecoverFromPassphraseViewModelType.swift | 4 ++-- .../KeyBackupRecoverFromPrivateKeyCoordinatorType.swift | 2 +- .../KeyBackupRecoverFromPrivateKeyViewModelType.swift | 4 ++-- .../KeyBackupRecoverFromRecoveryKeyCoordinatorType.swift | 2 +- .../KeyBackupRecoverFromRecoveryKeyViewModelType.swift | 4 ++-- .../Success/KeyBackupRecoverSuccessViewController.swift | 2 +- .../Setup/Intro/KeyBackupSetupIntroViewController.swift | 2 +- .../KeyBackup/Setup/KeyBackupSetupCoordinatorType.swift | 2 +- .../Passphrase/KeyBackupSetupPassphraseCoordinatorType.swift | 2 +- .../Passphrase/KeyBackupSetupPassphraseViewModelType.swift | 4 ++-- .../KeyBackupSetupSuccessFromPassphraseViewController.swift | 2 +- .../KeyBackupSetupSuccessFromRecoveryKeyViewController.swift | 2 +- .../KeyBackupSetupSuccessFromSecureBackupViewController.swift | 2 +- .../Common/KeyVerificationCoordinatorType.swift | 2 +- .../Loading/KeyVerificationDataLoadingCoordinatorType.swift | 2 +- .../Loading/KeyVerificationDataLoadingViewModelType.swift | 4 ++-- .../KeyVerificationScanConfirmationCoordinatorType.swift | 2 +- .../KeyVerificationScanConfirmationViewModelType.swift | 4 ++-- .../Verified/KeyVerificationVerifiedViewController.swift | 2 +- .../SAS/KeyVerificationVerifyBySASCoordinatorType.swift | 2 +- .../Verify/SAS/KeyVerificationVerifyBySASViewModelType.swift | 4 ++-- .../KeyVerificationVerifyByScanningCoordinatorType.swift | 2 +- .../KeyVerificationVerifyByScanningViewModelType.swift | 4 ++-- .../Incoming/DeviceVerificationIncomingCoordinatorType.swift | 2 +- .../Incoming/DeviceVerificationIncomingViewModelType.swift | 4 ++-- .../KeyVerificationManuallyVerifyCoordinatorType.swift | 2 +- .../KeyVerificationManuallyVerifyViewModelType.swift | 4 ++-- .../KeyVerificationSelfVerifyStartCoordinatorType.swift | 2 +- .../KeyVerificationSelfVerifyStartViewModelType.swift | 4 ++-- .../KeyVerificationSelfVerifyWaitCoordinatorType.swift | 2 +- .../KeyVerificationSelfVerifyWaitViewModelType.swift | 4 ++-- .../Device/Start/DeviceVerificationStartCoordinatorType.swift | 2 +- .../Device/Start/DeviceVerificationStartViewModelType.swift | 4 ++-- .../UserVerificationSessionStatusCoordinatorType.swift | 2 +- .../UserVerificationSessionStatusViewModelType.swift | 4 ++-- .../UserVerificationSessionsStatusCoordinatorType.swift | 2 +- .../UserVerificationSessionsStatusViewModelType.swift | 4 ++-- .../User/Start/UserVerificationStartCoordinatorType.swift | 2 +- .../User/Start/UserVerificationStartViewModelType.swift | 4 ++-- .../User/UserVerificationCoordinatorType.swift | 2 +- Riot/Modules/MediaPicker/MediaPickerCoordinatorType.swift | 2 +- Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift | 2 +- Riot/Modules/QRCode/Reader/QRCodeReaderViewController.swift | 2 +- .../Reauthentication/ReauthenticationCoordinatorType.swift | 2 +- .../Room/BubbleReactions/BubbleReactionsViewModelType.swift | 4 ++-- .../ReactionsMenu/ReactionsMenuViewModelType.swift | 4 ++-- .../ContextualMenu/RoomContextualMenuViewController.swift | 2 +- .../RoomCreationEventsModalCoordinatorType.swift | 2 +- .../RoomCreationEventsModalViewModelType.swift | 4 ++-- .../Room/CreationModal/RoomCreationModalCoordinatorType.swift | 2 +- .../Modules/Room/EditHistory/EditHistoryCoordinatorType.swift | 2 +- Riot/Modules/Room/EditHistory/EditHistoryViewModelType.swift | 4 ++-- .../Modules/Room/EmojiPicker/EmojiPickerCoordinatorType.swift | 2 +- Riot/Modules/Room/EmojiPicker/EmojiPickerViewModelType.swift | 4 ++-- .../Room/ReactionHistory/ReactionHistoryCoordinatorType.swift | 2 +- .../Room/ReactionHistory/ReactionHistoryViewModelType.swift | 4 ++-- Riot/Modules/Room/RoomInfo/RoomInfoCoordinatorType.swift | 2 +- .../RoomInfo/RoomInfoList/RoomInfoListCoordinatorType.swift | 2 +- .../RoomInfo/RoomInfoList/RoomInfoListViewModelType.swift | 4 ++-- .../RemoveJitsiWidget/RemoveJitsiWidgetViewDelegate.swift | 2 +- Riot/Modules/Rooms/RoomsDirectoryCoordinatorType.swift | 2 +- .../ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift | 2 +- .../Rooms/ShowDirectory/ShowDirectoryCoordinatorType.swift | 2 +- .../Rooms/ShowDirectory/ShowDirectoryViewModelType.swift | 4 ++-- .../SecretsRecoveryWithKeyCoordinatorType.swift | 2 +- .../RecoverWithKey/SecretsRecoveryWithKeyViewModelType.swift | 4 ++-- .../SecretsRecoveryWithPassphraseCoordinatorType.swift | 2 +- .../SecretsRecoveryWithPassphraseViewModelType.swift | 4 ++-- .../Secrets/Recover/SecretsRecoveryCoordinatorType.swift | 2 +- Riot/Modules/Secrets/Reset/SecretsResetCoordinatorType.swift | 2 +- Riot/Modules/Secrets/Reset/SecretsResetViewModelType.swift | 4 ++-- .../RecoveryKey/SecretsSetupRecoveryKeyCoordinatorType.swift | 2 +- .../RecoveryKey/SecretsSetupRecoveryKeyViewModelType.swift | 4 ++-- .../SecretsSetupRecoveryPassphraseCoordinatorType.swift | 2 +- .../SecretsSetupRecoveryPassphraseViewModelType.swift | 4 ++-- .../Modules/SecureBackup/Banners/SecureBackupBannerCell.swift | 2 +- .../Setup/Intro/SecureBackupSetupIntroViewController.swift | 2 +- .../SecureBackup/Setup/SecureBackupSetupCoordinatorType.swift | 2 +- .../Modal/Modal/ServiceTermsModalScreenCoordinatorType.swift | 2 +- .../Modal/Modal/ServiceTermsModalScreenViewModelType.swift | 4 ++-- .../ServiceTerms/Modal/ServiceTermsModalCoordinatorType.swift | 2 +- .../SetPinCode/EnterPinCode/EnterPinCodeCoordinatorType.swift | 2 +- .../SetPinCode/EnterPinCode/EnterPinCodeViewModelType.swift | 4 ++-- Riot/Modules/SetPinCode/SetPinCoordinatorType.swift | 2 +- .../SetupBiometrics/SetupBiometricsCoordinatorType.swift | 2 +- .../SetupBiometrics/SetupBiometricsViewModelType.swift | 4 ++-- .../Discovery/SettingsDiscoveryTableViewSection.swift | 2 +- .../Settings/Discovery/SettingsDiscoveryViewModelType.swift | 4 ++-- .../SettingsDiscoveryThreePidDetailsViewModelType.swift | 2 +- .../IdentityServer/SettingsIdentityServerViewModelType.swift | 2 +- .../KeyBackup/SettingsKeyBackupTableViewSection.swift | 2 +- .../Settings/KeyBackup/SettingsKeyBackupViewModelType.swift | 2 +- .../SecureBackup/SettingsSecureBackupTableViewSection.swift | 2 +- .../SecureBackup/SettingsSecureBackupViewModelType.swift | 2 +- Riot/Modules/Settings/SignOut/SignOutAlertPresenter.swift | 2 +- Riot/Modules/SideMenu/SideMenuActionView.swift | 2 +- Riot/Modules/SideMenu/SideMenuCoordinatorType.swift | 2 +- Riot/Modules/SideMenu/SideMenuViewModelType.swift | 4 ++-- Riot/Modules/SlidingModal/SlidingModalContainerView.swift | 2 +- Riot/Modules/Spaces/BetaAnnounceCell.swift | 2 +- Riot/Modules/SplitView/SplitViewCoordinatorType.swift | 2 +- Riot/Modules/SplitView/SplitViewPresentable.swift | 4 ++-- Riot/Modules/StartChat/InviteFriendsHeaderView.swift | 2 +- Riot/Modules/TabBar/TabBarCoordinatorType.swift | 2 +- Riot/Routers/NavigationRouterType.swift | 2 +- Riot/Routers/RootRouterType.swift | 2 +- .../FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift | 2 +- .../ScreenTemplate/TemplateScreenCoordinatorType.swift | 2 +- .../ScreenTemplate/TemplateScreenViewModelType.swift | 4 ++-- .../SimpleScreenTemplateViewController.swift | 2 +- 128 files changed, 165 insertions(+), 165 deletions(-) diff --git a/Riot/Coordinators/Coordinator.swift b/Riot/Coordinators/Coordinator.swift index 4d7f27b6a..3345c2f94 100755 --- a/Riot/Coordinators/Coordinator.swift +++ b/Riot/Coordinators/Coordinator.swift @@ -19,7 +19,7 @@ import UIKit /// Protocol describing a [Coordinator](http://khanlou.com/2015/10/coordinators-redux/). /// Coordinators are the objects which control the navigation flow of the application. /// It helps to isolate and reuse view controllers and pass dependencies down the navigation hierarchy. -protocol Coordinator: class { +protocol Coordinator: AnyObject { /// Starts job of the coordinator. func start() diff --git a/Riot/Managers/Call/CallPresenterDelegate.swift b/Riot/Managers/Call/CallPresenterDelegate.swift index 9c7f44687..a9f6df03e 100644 --- a/Riot/Managers/Call/CallPresenterDelegate.swift +++ b/Riot/Managers/Call/CallPresenterDelegate.swift @@ -17,7 +17,7 @@ import Foundation @objc -protocol CallPresenterDelegate: class { +protocol CallPresenterDelegate: AnyObject { // Call screens func callPresenter(_ presenter: CallPresenter, presentCallViewController viewController: UIViewController, diff --git a/Riot/Managers/Call/PiPView.swift b/Riot/Managers/Call/PiPView.swift index 8f5a0587a..54a199044 100644 --- a/Riot/Managers/Call/PiPView.swift +++ b/Riot/Managers/Call/PiPView.swift @@ -23,7 +23,7 @@ import UIKit case topLeft } -@objc protocol PiPViewDelegate: class { +@objc protocol PiPViewDelegate: AnyObject { @objc optional func pipView(_ view: PiPView, didMoveTo position: PiPViewPosition) @objc optional func pipViewDidTap(_ view: PiPView) } diff --git a/Riot/Managers/Theme/Themable.swift b/Riot/Managers/Theme/Themable.swift index f4f59f1e9..71931bfe8 100644 --- a/Riot/Managers/Theme/Themable.swift +++ b/Riot/Managers/Theme/Themable.swift @@ -16,6 +16,6 @@ import Foundation -@objc protocol Themable: class { +@objc protocol Themable: AnyObject { func update(theme: Theme) } diff --git a/Riot/Modules/Authentication/SocialLogin/SocialLoginListView.swift b/Riot/Modules/Authentication/SocialLogin/SocialLoginListView.swift index 6a66da782..e2e1a586f 100644 --- a/Riot/Modules/Authentication/SocialLogin/SocialLoginListView.swift +++ b/Riot/Modules/Authentication/SocialLogin/SocialLoginListView.swift @@ -17,7 +17,7 @@ import UIKit import Reusable -@objc protocol SocialLoginListViewDelegate: class { +@objc protocol SocialLoginListViewDelegate: AnyObject { func socialLoginListView(_ socialLoginListView: SocialLoginListView, didTapSocialButtonWithIdentifier identifier: String) } diff --git a/Riot/Modules/Call/Dialpad/DialpadViewController.swift b/Riot/Modules/Call/Dialpad/DialpadViewController.swift index 23e2c21ce..ce9a9fc66 100644 --- a/Riot/Modules/Call/Dialpad/DialpadViewController.swift +++ b/Riot/Modules/Call/Dialpad/DialpadViewController.swift @@ -19,7 +19,7 @@ import UIKit import libPhoneNumber_iOS -@objc protocol DialpadViewControllerDelegate: class { +@objc protocol DialpadViewControllerDelegate: AnyObject { @objc optional func dialpadViewControllerDidTapCall(_ viewController: DialpadViewController, withPhoneNumber phoneNumber: String) @objc optional func dialpadViewControllerDidTapClose(_ viewController: DialpadViewController) diff --git a/Riot/Modules/CallTransfer/CallTransferMainViewController.swift b/Riot/Modules/CallTransfer/CallTransferMainViewController.swift index af4b093d1..f7e23d0cd 100644 --- a/Riot/Modules/CallTransfer/CallTransferMainViewController.swift +++ b/Riot/Modules/CallTransfer/CallTransferMainViewController.swift @@ -18,7 +18,7 @@ import UIKit -@objc protocol CallTransferMainViewControllerDelegate: class { +@objc protocol CallTransferMainViewControllerDelegate: AnyObject { func callTransferMainViewControllerDidComplete(_ viewController: CallTransferMainViewController, consult: Bool, contact: MXKContact?, diff --git a/Riot/Modules/CallTransfer/SelectContact/CallTransferSelectContactViewController.swift b/Riot/Modules/CallTransfer/SelectContact/CallTransferSelectContactViewController.swift index 786cc4f71..df5c0a5a8 100644 --- a/Riot/Modules/CallTransfer/SelectContact/CallTransferSelectContactViewController.swift +++ b/Riot/Modules/CallTransfer/SelectContact/CallTransferSelectContactViewController.swift @@ -19,7 +19,7 @@ import UIKit import Reusable -protocol CallTransferSelectContactViewControllerDelegate: class { +protocol CallTransferSelectContactViewControllerDelegate: AnyObject { func callTransferSelectContactViewControllerDidSelectContact(_ viewController: CallTransferSelectContactViewController, contact: MXKContact?) } diff --git a/Riot/Modules/Camera/CameraPresenter.swift b/Riot/Modules/Camera/CameraPresenter.swift index 749e9abe5..a39bda7c0 100644 --- a/Riot/Modules/Camera/CameraPresenter.swift +++ b/Riot/Modules/Camera/CameraPresenter.swift @@ -18,7 +18,7 @@ import Foundation import UIKit import AVFoundation -@objc protocol CameraPresenterDelegate: class { +@objc protocol CameraPresenterDelegate: AnyObject { func cameraPresenter(_ presenter: CameraPresenter, didSelectImageData imageData: Data, withUTI uti: MXKUTI?) func cameraPresenter(_ presenter: CameraPresenter, didSelectVideoAt url: URL) func cameraPresenterDidCancel(_ cameraPresenter: CameraPresenter) diff --git a/Riot/Modules/CreateRoom/CreateRoomCoordinatorType.swift b/Riot/Modules/CreateRoom/CreateRoomCoordinatorType.swift index 2bddc933c..585538ddb 100644 --- a/Riot/Modules/CreateRoom/CreateRoomCoordinatorType.swift +++ b/Riot/Modules/CreateRoom/CreateRoomCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol CreateRoomCoordinatorDelegate: class { +protocol CreateRoomCoordinatorDelegate: AnyObject { func createRoomCoordinator(_ coordinator: CreateRoomCoordinatorType, didCreateNewRoom room: MXRoom) func createRoomCoordinatorDidCancel(_ coordinator: CreateRoomCoordinatorType) } diff --git a/Riot/Modules/CreateRoom/EnterNewRoomDetails/Cells/ChooseAvatarTableViewCell.swift b/Riot/Modules/CreateRoom/EnterNewRoomDetails/Cells/ChooseAvatarTableViewCell.swift index 82160a816..bcca816cf 100644 --- a/Riot/Modules/CreateRoom/EnterNewRoomDetails/Cells/ChooseAvatarTableViewCell.swift +++ b/Riot/Modules/CreateRoom/EnterNewRoomDetails/Cells/ChooseAvatarTableViewCell.swift @@ -17,7 +17,7 @@ import UIKit import Reusable -protocol ChooseAvatarTableViewCellDelegate: class { +protocol ChooseAvatarTableViewCellDelegate: AnyObject { func chooseAvatarTableViewCellDidTapChooseAvatar(_ cell: ChooseAvatarTableViewCell, sourceView: UIView) } diff --git a/Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsCoordinatorType.swift b/Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsCoordinatorType.swift index d2798fcb5..2d02d6cda 100644 --- a/Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsCoordinatorType.swift +++ b/Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol EnterNewRoomDetailsCoordinatorDelegate: class { +protocol EnterNewRoomDetailsCoordinatorDelegate: AnyObject { func enterNewRoomDetailsCoordinator(_ coordinator: EnterNewRoomDetailsCoordinatorType, didCreateNewRoom room: MXRoom) func enterNewRoomDetailsCoordinatorDidCancel(_ coordinator: EnterNewRoomDetailsCoordinatorType) } diff --git a/Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsViewModelType.swift b/Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsViewModelType.swift index ea6b388c2..be053323d 100644 --- a/Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsViewModelType.swift +++ b/Riot/Modules/CreateRoom/EnterNewRoomDetails/EnterNewRoomDetailsViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol EnterNewRoomDetailsViewModelViewDelegate: class { +protocol EnterNewRoomDetailsViewModelViewDelegate: AnyObject { func enterNewRoomDetailsViewModel(_ viewModel: EnterNewRoomDetailsViewModelType, didUpdateViewState viewSate: EnterNewRoomDetailsViewState) } -protocol EnterNewRoomDetailsViewModelCoordinatorDelegate: class { +protocol EnterNewRoomDetailsViewModelCoordinatorDelegate: AnyObject { func enterNewRoomDetailsViewModel(_ viewModel: EnterNewRoomDetailsViewModelType, didCreateNewRoom room: MXRoom) func enterNewRoomDetailsViewModel(_ viewModel: EnterNewRoomDetailsViewModelType, didTapChooseAvatar sourceView: UIView) func enterNewRoomDetailsViewModelDidCancel(_ viewModel: EnterNewRoomDetailsViewModelType) diff --git a/Riot/Modules/CrossSigning/Banners/CrossSigningSetupBannerCell.swift b/Riot/Modules/CrossSigning/Banners/CrossSigningSetupBannerCell.swift index 6a7161bea..f0c13b154 100644 --- a/Riot/Modules/CrossSigning/Banners/CrossSigningSetupBannerCell.swift +++ b/Riot/Modules/CrossSigning/Banners/CrossSigningSetupBannerCell.swift @@ -16,7 +16,7 @@ import UIKit -@objc protocol CrossSigningSetupBannerCellDelegate: class { +@objc protocol CrossSigningSetupBannerCellDelegate: AnyObject { func crossSigningSetupBannerCellDidTapCloseAction(_ cell: CrossSigningSetupBannerCell) } diff --git a/Riot/Modules/CrossSigning/Setup/CrossSigningSetupCoordinatorType.swift b/Riot/Modules/CrossSigning/Setup/CrossSigningSetupCoordinatorType.swift index 1dc620d3f..ccd85e17b 100644 --- a/Riot/Modules/CrossSigning/Setup/CrossSigningSetupCoordinatorType.swift +++ b/Riot/Modules/CrossSigning/Setup/CrossSigningSetupCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol CrossSigningSetupCoordinatorDelegate: class { +protocol CrossSigningSetupCoordinatorDelegate: AnyObject { func crossSigningSetupCoordinatorDidComplete(_ coordinator: CrossSigningSetupCoordinatorType) func crossSigningSetupCoordinatorDidCancel(_ coordinator: CrossSigningSetupCoordinatorType) func crossSigningSetupCoordinator(_ coordinator: CrossSigningSetupCoordinatorType, didFailWithError error: Error) diff --git a/Riot/Modules/GDPR/GDPRConsentViewController.swift b/Riot/Modules/GDPR/GDPRConsentViewController.swift index 29ebdc22c..4a5cdee8d 100644 --- a/Riot/Modules/GDPR/GDPRConsentViewController.swift +++ b/Riot/Modules/GDPR/GDPRConsentViewController.swift @@ -16,7 +16,7 @@ import Foundation -@objc protocol GDPRConsentViewControllerDelegate: class { +@objc protocol GDPRConsentViewControllerDelegate: AnyObject { func gdprConsentViewControllerDidConsentToGDPRWithSuccess(_ gdprConsentViewController: GDPRConsentViewController) } diff --git a/Riot/Modules/KeyBackup/Recover/KeyBackupRecoverCoordinatorType.swift b/Riot/Modules/KeyBackup/Recover/KeyBackupRecoverCoordinatorType.swift index 30d9c34d3..52bb891ea 100644 --- a/Riot/Modules/KeyBackup/Recover/KeyBackupRecoverCoordinatorType.swift +++ b/Riot/Modules/KeyBackup/Recover/KeyBackupRecoverCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol KeyBackupRecoverCoordinatorDelegate: class { +protocol KeyBackupRecoverCoordinatorDelegate: AnyObject { func keyBackupRecoverCoordinatorDidRecover(_ keyBackupRecoverCoordinator: KeyBackupRecoverCoordinatorType) func keyBackupRecoverCoordinatorDidCancel(_ keyBackupRecoverCoordinator: KeyBackupRecoverCoordinatorType) } diff --git a/Riot/Modules/KeyBackup/Recover/Passphrase/KeyBackupRecoverFromPassphraseCoordinatorType.swift b/Riot/Modules/KeyBackup/Recover/Passphrase/KeyBackupRecoverFromPassphraseCoordinatorType.swift index c33cdcf06..a3bc9030b 100644 --- a/Riot/Modules/KeyBackup/Recover/Passphrase/KeyBackupRecoverFromPassphraseCoordinatorType.swift +++ b/Riot/Modules/KeyBackup/Recover/Passphrase/KeyBackupRecoverFromPassphraseCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol KeyBackupRecoverFromPassphraseCoordinatorDelegate: class { +protocol KeyBackupRecoverFromPassphraseCoordinatorDelegate: AnyObject { func keyBackupRecoverFromPassphraseCoordinatorDidRecover(_ keyBackupRecoverFromPassphraseCoordinator: KeyBackupRecoverFromPassphraseCoordinatorType) func keyBackupRecoverFromPassphraseCoordinatorDoNotKnowPassphrase(_ keyBackupRecoverFromPassphraseCoordinator: KeyBackupRecoverFromPassphraseCoordinatorType) func keyBackupRecoverFromPassphraseCoordinatorDidCancel(_ keyBackupRecoverFromPassphraseCoordinator: KeyBackupRecoverFromPassphraseCoordinatorType) diff --git a/Riot/Modules/KeyBackup/Recover/Passphrase/KeyBackupRecoverFromPassphraseViewModelType.swift b/Riot/Modules/KeyBackup/Recover/Passphrase/KeyBackupRecoverFromPassphraseViewModelType.swift index 8b19bc589..69bc84b01 100644 --- a/Riot/Modules/KeyBackup/Recover/Passphrase/KeyBackupRecoverFromPassphraseViewModelType.swift +++ b/Riot/Modules/KeyBackup/Recover/Passphrase/KeyBackupRecoverFromPassphraseViewModelType.swift @@ -16,11 +16,11 @@ import Foundation -protocol KeyBackupRecoverFromPassphraseViewModelViewDelegate: class { +protocol KeyBackupRecoverFromPassphraseViewModelViewDelegate: AnyObject { func keyBackupRecoverFromPassphraseViewModel(_ viewModel: KeyBackupRecoverFromPassphraseViewModelType, didUpdateViewState viewSate: KeyBackupRecoverFromPassphraseViewState) } -protocol KeyBackupRecoverFromPassphraseViewModelCoordinatorDelegate: class { +protocol KeyBackupRecoverFromPassphraseViewModelCoordinatorDelegate: AnyObject { func keyBackupRecoverFromPassphraseViewModelDidRecover(_ viewModel: KeyBackupRecoverFromPassphraseViewModelType) func keyBackupRecoverFromPassphraseViewModelDidCancel(_ viewModel: KeyBackupRecoverFromPassphraseViewModelType) func keyBackupRecoverFromPassphraseViewModelDoNotKnowPassphrase(_ viewModel: KeyBackupRecoverFromPassphraseViewModelType) diff --git a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyCoordinatorType.swift b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyCoordinatorType.swift index aab042ba5..7146eeeae 100644 --- a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyCoordinatorType.swift +++ b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol KeyBackupRecoverFromPrivateKeyCoordinatorDelegate: class { +protocol KeyBackupRecoverFromPrivateKeyCoordinatorDelegate: AnyObject { func keyBackupRecoverFromPrivateKeyCoordinatorDidRecover(_ coordinator: KeyBackupRecoverFromPrivateKeyCoordinatorType) func keyBackupRecoverFromPrivateKeyCoordinatorDidPrivateKeyFail(_ coordinator: KeyBackupRecoverFromPrivateKeyCoordinatorType) func keyBackupRecoverFromPrivateKeyCoordinatorDidCancel(_ coordinator: KeyBackupRecoverFromPrivateKeyCoordinatorType) diff --git a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewModelType.swift b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewModelType.swift index 1188e0560..396f401f1 100644 --- a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewModelType.swift +++ b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol KeyBackupRecoverFromPrivateKeyViewModelViewDelegate: class { +protocol KeyBackupRecoverFromPrivateKeyViewModelViewDelegate: AnyObject { func keyBackupRecoverFromPrivateKeyViewModel(_ viewModel: KeyBackupRecoverFromPrivateKeyViewModelType, didUpdateViewState viewSate: KeyBackupRecoverFromPrivateKeyViewState) } -protocol KeyBackupRecoverFromPrivateKeyViewModelCoordinatorDelegate: class { +protocol KeyBackupRecoverFromPrivateKeyViewModelCoordinatorDelegate: AnyObject { func keyBackupRecoverFromPrivateKeyViewModelDidRecover(_ viewModel: KeyBackupRecoverFromPrivateKeyViewModelType) func keyBackupRecoverFromPrivateKeyViewModelDidPrivateKeyFail(_ viewModel: KeyBackupRecoverFromPrivateKeyViewModelType) func keyBackupRecoverFromPrivateKeyViewModelDidCancel(_ viewModel: KeyBackupRecoverFromPrivateKeyViewModelType) diff --git a/Riot/Modules/KeyBackup/Recover/RecoveryKey/KeyBackupRecoverFromRecoveryKeyCoordinatorType.swift b/Riot/Modules/KeyBackup/Recover/RecoveryKey/KeyBackupRecoverFromRecoveryKeyCoordinatorType.swift index 11d528b4f..c354fd13f 100644 --- a/Riot/Modules/KeyBackup/Recover/RecoveryKey/KeyBackupRecoverFromRecoveryKeyCoordinatorType.swift +++ b/Riot/Modules/KeyBackup/Recover/RecoveryKey/KeyBackupRecoverFromRecoveryKeyCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol KeyBackupRecoverFromRecoveryKeyCoordinatorDelegate: class { +protocol KeyBackupRecoverFromRecoveryKeyCoordinatorDelegate: AnyObject { func keyBackupRecoverFromPassphraseCoordinatorDidRecover(_ keyBackupRecoverFromRecoveryKeyCoordinator: KeyBackupRecoverFromRecoveryKeyCoordinatorType) func keyBackupRecoverFromPassphraseCoordinatorDidCancel(_ keyBackupRecoverFromRecoveryKeyCoordinator: KeyBackupRecoverFromRecoveryKeyCoordinatorType) } diff --git a/Riot/Modules/KeyBackup/Recover/RecoveryKey/KeyBackupRecoverFromRecoveryKeyViewModelType.swift b/Riot/Modules/KeyBackup/Recover/RecoveryKey/KeyBackupRecoverFromRecoveryKeyViewModelType.swift index e952c70a3..366d547d0 100644 --- a/Riot/Modules/KeyBackup/Recover/RecoveryKey/KeyBackupRecoverFromRecoveryKeyViewModelType.swift +++ b/Riot/Modules/KeyBackup/Recover/RecoveryKey/KeyBackupRecoverFromRecoveryKeyViewModelType.swift @@ -16,11 +16,11 @@ import Foundation -protocol KeyBackupRecoverFromRecoveryKeyViewModelViewDelegate: class { +protocol KeyBackupRecoverFromRecoveryKeyViewModelViewDelegate: AnyObject { func keyBackupRecoverFromPassphraseViewModel(_ viewModel: KeyBackupRecoverFromRecoveryKeyViewModelType, didUpdateViewState viewSate: KeyBackupRecoverFromRecoveryKeyViewState) } -protocol KeyBackupRecoverFromRecoveryKeyViewModelCoordinatorDelegate: class { +protocol KeyBackupRecoverFromRecoveryKeyViewModelCoordinatorDelegate: AnyObject { func keyBackupRecoverFromRecoveryKeyViewModelDidRecover(_ viewModel: KeyBackupRecoverFromRecoveryKeyViewModelType) func keyBackupRecoverFromRecoveryKeyViewModelDidCancel(_ viewModel: KeyBackupRecoverFromRecoveryKeyViewModelType) } diff --git a/Riot/Modules/KeyBackup/Recover/Success/KeyBackupRecoverSuccessViewController.swift b/Riot/Modules/KeyBackup/Recover/Success/KeyBackupRecoverSuccessViewController.swift index dd5a834da..8b58b241a 100644 --- a/Riot/Modules/KeyBackup/Recover/Success/KeyBackupRecoverSuccessViewController.swift +++ b/Riot/Modules/KeyBackup/Recover/Success/KeyBackupRecoverSuccessViewController.swift @@ -16,7 +16,7 @@ import UIKit -protocol KeyBackupRecoverSuccessViewControllerDelegate: class { +protocol KeyBackupRecoverSuccessViewControllerDelegate: AnyObject { func keyBackupRecoverSuccessViewControllerDidTapDone(_ keyBackupRecoverSuccessViewController: KeyBackupRecoverSuccessViewController) } diff --git a/Riot/Modules/KeyBackup/Setup/Intro/KeyBackupSetupIntroViewController.swift b/Riot/Modules/KeyBackup/Setup/Intro/KeyBackupSetupIntroViewController.swift index c968500ed..2f4284fbd 100644 --- a/Riot/Modules/KeyBackup/Setup/Intro/KeyBackupSetupIntroViewController.swift +++ b/Riot/Modules/KeyBackup/Setup/Intro/KeyBackupSetupIntroViewController.swift @@ -16,7 +16,7 @@ import UIKit -protocol KeyBackupSetupIntroViewControllerDelegate: class { +protocol KeyBackupSetupIntroViewControllerDelegate: AnyObject { func keyBackupSetupIntroViewControllerDidTapSetupAction(_ keyBackupSetupIntroViewController: KeyBackupSetupIntroViewController) func keyBackupSetupIntroViewControllerDidCancel(_ keyBackupSetupIntroViewController: KeyBackupSetupIntroViewController) } diff --git a/Riot/Modules/KeyBackup/Setup/KeyBackupSetupCoordinatorType.swift b/Riot/Modules/KeyBackup/Setup/KeyBackupSetupCoordinatorType.swift index f5a5dd0b0..612be7a1d 100644 --- a/Riot/Modules/KeyBackup/Setup/KeyBackupSetupCoordinatorType.swift +++ b/Riot/Modules/KeyBackup/Setup/KeyBackupSetupCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol KeyBackupSetupCoordinatorDelegate: class { +protocol KeyBackupSetupCoordinatorDelegate: AnyObject { func keyBackupSetupCoordinatorDidCancel(_ keyBackupSetupCoordinator: KeyBackupSetupCoordinatorType) func keyBackupSetupCoordinatorDidSetupRecoveryKey(_ keyBackupSetupCoordinator: KeyBackupSetupCoordinatorType) } diff --git a/Riot/Modules/KeyBackup/Setup/Passphrase/KeyBackupSetupPassphraseCoordinatorType.swift b/Riot/Modules/KeyBackup/Setup/Passphrase/KeyBackupSetupPassphraseCoordinatorType.swift index f94722adb..24403a387 100644 --- a/Riot/Modules/KeyBackup/Setup/Passphrase/KeyBackupSetupPassphraseCoordinatorType.swift +++ b/Riot/Modules/KeyBackup/Setup/Passphrase/KeyBackupSetupPassphraseCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol KeyBackupSetupPassphraseCoordinatorDelegate: class { +protocol KeyBackupSetupPassphraseCoordinatorDelegate: AnyObject { func keyBackupSetupPassphraseCoordinator(_ keyBackupSetupPassphraseCoordinator: KeyBackupSetupPassphraseCoordinatorType, didCreateBackupFromPassphraseWithResultingRecoveryKey recoveryKey: String) func keyBackupSetupPassphraseCoordinator(_ keyBackupSetupPassphraseCoordinator: KeyBackupSetupPassphraseCoordinatorType, didCreateBackupFromRecoveryKey recoveryKey: String) func keyBackupSetupPassphraseCoordinatorDidCancel(_ keyBackupSetupPassphraseCoordinator: KeyBackupSetupPassphraseCoordinatorType) diff --git a/Riot/Modules/KeyBackup/Setup/Passphrase/KeyBackupSetupPassphraseViewModelType.swift b/Riot/Modules/KeyBackup/Setup/Passphrase/KeyBackupSetupPassphraseViewModelType.swift index 2f4b2dfaa..89da31b4d 100644 --- a/Riot/Modules/KeyBackup/Setup/Passphrase/KeyBackupSetupPassphraseViewModelType.swift +++ b/Riot/Modules/KeyBackup/Setup/Passphrase/KeyBackupSetupPassphraseViewModelType.swift @@ -16,12 +16,12 @@ import Foundation -protocol KeyBackupSetupPassphraseViewModelViewDelegate: class { +protocol KeyBackupSetupPassphraseViewModelViewDelegate: AnyObject { func keyBackupSetupPassphraseViewModel(_ viewModel: KeyBackupSetupPassphraseViewModelType, didUpdateViewState viewSate: KeyBackupSetupPassphraseViewState) func keyBackupSetupPassphraseViewModelShowSkipAlert(_ viewModel: KeyBackupSetupPassphraseViewModelType) } -protocol KeyBackupSetupPassphraseViewModelCoordinatorDelegate: class { +protocol KeyBackupSetupPassphraseViewModelCoordinatorDelegate: AnyObject { func keyBackupSetupPassphraseViewModel(_ viewModel: KeyBackupSetupPassphraseViewModelType, didCreateBackupFromPassphraseWithResultingRecoveryKey recoveryKey: String) func keyBackupSetupPassphraseViewModel(_ viewModel: KeyBackupSetupPassphraseViewModelType, didCreateBackupFromRecoveryKey recoveryKey: String) func keyBackupSetupPassphraseViewModelDidCancel(_ viewModel: KeyBackupSetupPassphraseViewModelType) diff --git a/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromPassphraseViewController.swift b/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromPassphraseViewController.swift index 57fe04ba9..563d4b0b6 100644 --- a/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromPassphraseViewController.swift +++ b/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromPassphraseViewController.swift @@ -16,7 +16,7 @@ import UIKit -protocol KeyBackupSetupSuccessFromPassphraseViewControllerDelegate: class { +protocol KeyBackupSetupSuccessFromPassphraseViewControllerDelegate: AnyObject { func keyBackupSetupSuccessFromPassphraseViewControllerDidTapDoneAction(_ viewController: KeyBackupSetupSuccessFromPassphraseViewController) } diff --git a/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromRecoveryKeyViewController.swift b/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromRecoveryKeyViewController.swift index 6f474f753..0c33c5915 100644 --- a/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromRecoveryKeyViewController.swift +++ b/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromRecoveryKeyViewController.swift @@ -16,7 +16,7 @@ import UIKit -protocol KeyBackupSetupSuccessFromRecoveryKeyViewControllerDelegate: class { +protocol KeyBackupSetupSuccessFromRecoveryKeyViewControllerDelegate: AnyObject { func keyBackupSetupSuccessFromRecoveryKeyViewControllerDidTapDoneAction(_ viewController: KeyBackupSetupSuccessFromRecoveryKeyViewController) } diff --git a/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromSecureBackupViewController.swift b/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromSecureBackupViewController.swift index c369cb5e9..dcd23e6d6 100644 --- a/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromSecureBackupViewController.swift +++ b/Riot/Modules/KeyBackup/Setup/Success/KeyBackupSetupSuccessFromSecureBackupViewController.swift @@ -16,7 +16,7 @@ import UIKit -protocol KeyBackupSetupSuccessFromSecureBackupViewControllerDelegate: class { +protocol KeyBackupSetupSuccessFromSecureBackupViewControllerDelegate: AnyObject { func keyBackupSetupSuccessFromSecureBackupViewControllerDidTapDoneAction(_ viewController: KeyBackupSetupSuccessFromSecureBackupViewController) } diff --git a/Riot/Modules/KeyVerification/Common/KeyVerificationCoordinatorType.swift b/Riot/Modules/KeyVerification/Common/KeyVerificationCoordinatorType.swift index 901d6b11d..ca1731afd 100644 --- a/Riot/Modules/KeyVerification/Common/KeyVerificationCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Common/KeyVerificationCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol KeyVerificationCoordinatorDelegate: class { +protocol KeyVerificationCoordinatorDelegate: AnyObject { func keyVerificationCoordinatorDidComplete(_ coordinator: KeyVerificationCoordinatorType, otherUserId: String, otherDeviceId: String) func keyVerificationCoordinatorDidCancel(_ coordinator: KeyVerificationCoordinatorType) } diff --git a/Riot/Modules/KeyVerification/Common/Loading/KeyVerificationDataLoadingCoordinatorType.swift b/Riot/Modules/KeyVerification/Common/Loading/KeyVerificationDataLoadingCoordinatorType.swift index 8a7ba1dae..f0ff8bfa2 100644 --- a/Riot/Modules/KeyVerification/Common/Loading/KeyVerificationDataLoadingCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Common/Loading/KeyVerificationDataLoadingCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol KeyVerificationDataLoadingCoordinatorDelegate: class { +protocol KeyVerificationDataLoadingCoordinatorDelegate: AnyObject { func keyVerificationDataLoadingCoordinator(_ coordinator: KeyVerificationDataLoadingCoordinatorType, didLoadUser user: MXUser, device: MXDeviceInfo) func keyVerificationDataLoadingCoordinator(_ coordinator: KeyVerificationDataLoadingCoordinatorType, didAcceptKeyVerificationRequestWithTransaction transaction: MXKeyVerificationTransaction) func keyVerificationDataLoadingCoordinator(_ coordinator: KeyVerificationDataLoadingCoordinatorType, didAcceptKeyVerificationRequest keyVerificationRequest: MXKeyVerificationRequest) diff --git a/Riot/Modules/KeyVerification/Common/Loading/KeyVerificationDataLoadingViewModelType.swift b/Riot/Modules/KeyVerification/Common/Loading/KeyVerificationDataLoadingViewModelType.swift index d55bcc3bd..223ce6f50 100644 --- a/Riot/Modules/KeyVerification/Common/Loading/KeyVerificationDataLoadingViewModelType.swift +++ b/Riot/Modules/KeyVerification/Common/Loading/KeyVerificationDataLoadingViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol KeyVerificationDataLoadingViewModelViewDelegate: class { +protocol KeyVerificationDataLoadingViewModelViewDelegate: AnyObject { func keyVerificationDataLoadingViewModel(_ viewModel: KeyVerificationDataLoadingViewModelType, didUpdateViewState viewSate: KeyVerificationDataLoadingViewState) } -protocol KeyVerificationDataLoadingViewModelCoordinatorDelegate: class { +protocol KeyVerificationDataLoadingViewModelCoordinatorDelegate: AnyObject { func keyVerificationDataLoadingViewModel(_ viewModel: KeyVerificationDataLoadingViewModelType, didLoadUser user: MXUser, device: MXDeviceInfo) func keyVerificationDataLoadingViewModel(_ viewModel: KeyVerificationDataLoadingViewModelType, didAcceptKeyVerificationWithTransaction transaction: MXKeyVerificationTransaction) func keyVerificationDataLoadingViewModel(_ viewModel: KeyVerificationDataLoadingViewModelType, didAcceptKeyVerificationRequest keyVerificationRequest: MXKeyVerificationRequest) diff --git a/Riot/Modules/KeyVerification/Common/ScanConfirmation/KeyVerificationScanConfirmationCoordinatorType.swift b/Riot/Modules/KeyVerification/Common/ScanConfirmation/KeyVerificationScanConfirmationCoordinatorType.swift index 35a2381c4..8087fadb2 100644 --- a/Riot/Modules/KeyVerification/Common/ScanConfirmation/KeyVerificationScanConfirmationCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Common/ScanConfirmation/KeyVerificationScanConfirmationCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol KeyVerificationScanConfirmationCoordinatorDelegate: class { +protocol KeyVerificationScanConfirmationCoordinatorDelegate: AnyObject { func keyVerificationScanConfirmationCoordinatorDidComplete(_ coordinator: KeyVerificationScanConfirmationCoordinatorType) func keyVerificationScanConfirmationCoordinatorDidCancel(_ coordinator: KeyVerificationScanConfirmationCoordinatorType) } diff --git a/Riot/Modules/KeyVerification/Common/ScanConfirmation/KeyVerificationScanConfirmationViewModelType.swift b/Riot/Modules/KeyVerification/Common/ScanConfirmation/KeyVerificationScanConfirmationViewModelType.swift index 03d843560..fc11ea2bd 100644 --- a/Riot/Modules/KeyVerification/Common/ScanConfirmation/KeyVerificationScanConfirmationViewModelType.swift +++ b/Riot/Modules/KeyVerification/Common/ScanConfirmation/KeyVerificationScanConfirmationViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol KeyVerificationScanConfirmationViewModelViewDelegate: class { +protocol KeyVerificationScanConfirmationViewModelViewDelegate: AnyObject { func keyVerificationScanConfirmationViewModel(_ viewModel: KeyVerificationScanConfirmationViewModelType, didUpdateViewState viewSate: KeyVerificationScanConfirmationViewState) } -protocol KeyVerificationScanConfirmationViewModelCoordinatorDelegate: class { +protocol KeyVerificationScanConfirmationViewModelCoordinatorDelegate: AnyObject { func keyVerificationScanConfirmationViewModelDidComplete(_ viewModel: KeyVerificationScanConfirmationViewModelType) func keyVerificationScanConfirmationViewModelDidCancel(_ viewModel: KeyVerificationScanConfirmationViewModelType) } diff --git a/Riot/Modules/KeyVerification/Common/Verified/KeyVerificationVerifiedViewController.swift b/Riot/Modules/KeyVerification/Common/Verified/KeyVerificationVerifiedViewController.swift index ed869052f..32cd0cf6a 100644 --- a/Riot/Modules/KeyVerification/Common/Verified/KeyVerificationVerifiedViewController.swift +++ b/Riot/Modules/KeyVerification/Common/Verified/KeyVerificationVerifiedViewController.swift @@ -18,7 +18,7 @@ import UIKit -protocol KeyVerificationVerifiedViewControllerDelegate: class { +protocol KeyVerificationVerifiedViewControllerDelegate: AnyObject { func keyVerificationVerifiedViewControllerDidTapSetupAction(_ viewController: KeyVerificationVerifiedViewController) func keyVerificationVerifiedViewControllerDidCancel(_ viewController: KeyVerificationVerifiedViewController) } diff --git a/Riot/Modules/KeyVerification/Common/Verify/SAS/KeyVerificationVerifyBySASCoordinatorType.swift b/Riot/Modules/KeyVerification/Common/Verify/SAS/KeyVerificationVerifyBySASCoordinatorType.swift index 378e2517e..77ac567ff 100644 --- a/Riot/Modules/KeyVerification/Common/Verify/SAS/KeyVerificationVerifyBySASCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Common/Verify/SAS/KeyVerificationVerifyBySASCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol KeyVerificationVerifyBySASCoordinatorDelegate: class { +protocol KeyVerificationVerifyBySASCoordinatorDelegate: AnyObject { func keyVerificationVerifyBySASCoordinatorDidComplete(_ coordinator: KeyVerificationVerifyBySASCoordinatorType) func keyVerificationVerifyBySASCoordinatorDidCancel(_ coordinator: KeyVerificationVerifyBySASCoordinatorType) } diff --git a/Riot/Modules/KeyVerification/Common/Verify/SAS/KeyVerificationVerifyBySASViewModelType.swift b/Riot/Modules/KeyVerification/Common/Verify/SAS/KeyVerificationVerifyBySASViewModelType.swift index a5686bc7a..10c26756a 100644 --- a/Riot/Modules/KeyVerification/Common/Verify/SAS/KeyVerificationVerifyBySASViewModelType.swift +++ b/Riot/Modules/KeyVerification/Common/Verify/SAS/KeyVerificationVerifyBySASViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol KeyVerificationVerifyBySASViewModelViewDelegate: class { +protocol KeyVerificationVerifyBySASViewModelViewDelegate: AnyObject { func keyVerificationVerifyBySASViewModel(_ viewModel: KeyVerificationVerifyBySASViewModelType, didUpdateViewState viewSate: KeyVerificationVerifyViewState) } -protocol KeyVerificationVerifyBySASViewModelCoordinatorDelegate: class { +protocol KeyVerificationVerifyBySASViewModelCoordinatorDelegate: AnyObject { func keyVerificationVerifyViewModelDidComplete(_ viewModel: KeyVerificationVerifyBySASViewModelType) func keyVerificationVerifyViewModelDidCancel(_ viewModel: KeyVerificationVerifyBySASViewModelType) } diff --git a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningCoordinatorType.swift b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningCoordinatorType.swift index 0bf2711f6..5df1ebde6 100644 --- a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol KeyVerificationVerifyByScanningCoordinatorDelegate: class { +protocol KeyVerificationVerifyByScanningCoordinatorDelegate: AnyObject { func keyVerificationVerifyByScanningCoordinatorDidCancel(_ coordinator: KeyVerificationVerifyByScanningCoordinatorType) func keyVerificationVerifyByScanningCoordinator(_ coordinator: KeyVerificationVerifyByScanningCoordinatorType, didScanOtherQRCodeData qrCodeData: MXQRCodeData, withTransaction transaction: MXQRCodeTransaction) func keyVerificationVerifyByScanningCoordinator(_ coordinator: KeyVerificationVerifyByScanningCoordinatorType, qrCodeDidScannedByOtherWithTransaction transaction: MXQRCodeTransaction) diff --git a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewModelType.swift b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewModelType.swift index 4be0568d5..d7eedfabc 100644 --- a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewModelType.swift +++ b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol KeyVerificationVerifyByScanningViewModelViewDelegate: class { +protocol KeyVerificationVerifyByScanningViewModelViewDelegate: AnyObject { func keyVerificationVerifyByScanningViewModel(_ viewModel: KeyVerificationVerifyByScanningViewModelType, didUpdateViewState viewSate: KeyVerificationVerifyByScanningViewState) } -protocol KeyVerificationVerifyByScanningViewModelCoordinatorDelegate: class { +protocol KeyVerificationVerifyByScanningViewModelCoordinatorDelegate: AnyObject { func keyVerificationVerifyByScanningViewModelDidCancel(_ viewModel: KeyVerificationVerifyByScanningViewModelType) func keyVerificationVerifyByScanningViewModel(_ viewModel: KeyVerificationVerifyByScanningViewModelType, didScanOtherQRCodeData qrCodeData: MXQRCodeData, withTransaction transaction: MXQRCodeTransaction) diff --git a/Riot/Modules/KeyVerification/Device/Incoming/DeviceVerificationIncomingCoordinatorType.swift b/Riot/Modules/KeyVerification/Device/Incoming/DeviceVerificationIncomingCoordinatorType.swift index 46e135212..1d5e600ab 100644 --- a/Riot/Modules/KeyVerification/Device/Incoming/DeviceVerificationIncomingCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Device/Incoming/DeviceVerificationIncomingCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol DeviceVerificationIncomingCoordinatorDelegate: class { +protocol DeviceVerificationIncomingCoordinatorDelegate: AnyObject { func deviceVerificationIncomingCoordinator(_ coordinator: DeviceVerificationIncomingCoordinatorType, didAcceptTransaction message: MXSASTransaction) func deviceVerificationIncomingCoordinatorDidCancel(_ coordinator: DeviceVerificationIncomingCoordinatorType) } diff --git a/Riot/Modules/KeyVerification/Device/Incoming/DeviceVerificationIncomingViewModelType.swift b/Riot/Modules/KeyVerification/Device/Incoming/DeviceVerificationIncomingViewModelType.swift index 465fb4013..48b148aa1 100644 --- a/Riot/Modules/KeyVerification/Device/Incoming/DeviceVerificationIncomingViewModelType.swift +++ b/Riot/Modules/KeyVerification/Device/Incoming/DeviceVerificationIncomingViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol DeviceVerificationIncomingViewModelViewDelegate: class { +protocol DeviceVerificationIncomingViewModelViewDelegate: AnyObject { func deviceVerificationIncomingViewModel(_ viewModel: DeviceVerificationIncomingViewModelType, didUpdateViewState viewSate: DeviceVerificationIncomingViewState) } -protocol DeviceVerificationIncomingViewModelCoordinatorDelegate: class { +protocol DeviceVerificationIncomingViewModelCoordinatorDelegate: AnyObject { func deviceVerificationIncomingViewModel(_ viewModel: DeviceVerificationIncomingViewModelType, didAcceptTransaction transaction: MXSASTransaction) func deviceVerificationIncomingViewModelDidCancel(_ viewModel: DeviceVerificationIncomingViewModelType) } diff --git a/Riot/Modules/KeyVerification/Device/ManuallyVerify/KeyVerificationManuallyVerifyCoordinatorType.swift b/Riot/Modules/KeyVerification/Device/ManuallyVerify/KeyVerificationManuallyVerifyCoordinatorType.swift index 7f37b9564..ef098fcd2 100644 --- a/Riot/Modules/KeyVerification/Device/ManuallyVerify/KeyVerificationManuallyVerifyCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Device/ManuallyVerify/KeyVerificationManuallyVerifyCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol KeyVerificationManuallyVerifyCoordinatorDelegate: class { +protocol KeyVerificationManuallyVerifyCoordinatorDelegate: AnyObject { func keyVerificationManuallyVerifyCoordinator(_ coordinator: KeyVerificationManuallyVerifyCoordinatorType, didVerifiedDeviceWithId deviceId: String, of userId: String) func keyVerificationManuallyVerifyCoordinatorDidCancel(_ coordinator: KeyVerificationManuallyVerifyCoordinatorType) } diff --git a/Riot/Modules/KeyVerification/Device/ManuallyVerify/KeyVerificationManuallyVerifyViewModelType.swift b/Riot/Modules/KeyVerification/Device/ManuallyVerify/KeyVerificationManuallyVerifyViewModelType.swift index 49f1972a5..1f1a73a57 100644 --- a/Riot/Modules/KeyVerification/Device/ManuallyVerify/KeyVerificationManuallyVerifyViewModelType.swift +++ b/Riot/Modules/KeyVerification/Device/ManuallyVerify/KeyVerificationManuallyVerifyViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol KeyVerificationManuallyVerifyViewModelViewDelegate: class { +protocol KeyVerificationManuallyVerifyViewModelViewDelegate: AnyObject { func keyVerificationManuallyVerifyViewModel(_ viewModel: KeyVerificationManuallyVerifyViewModelType, didUpdateViewState viewSate: KeyVerificationManuallyVerifyViewState) } -protocol KeyVerificationManuallyVerifyViewModelCoordinatorDelegate: class { +protocol KeyVerificationManuallyVerifyViewModelCoordinatorDelegate: AnyObject { func keyVerificationManuallyVerifyViewModel(_ viewModel: KeyVerificationManuallyVerifyViewModelType, didVerifiedDeviceWithId deviceId: String, of userId: String) func keyVerificationManuallyVerifyViewModelDidCancel(_ viewModel: KeyVerificationManuallyVerifyViewModelType) } diff --git a/Riot/Modules/KeyVerification/Device/SelfVerifyStart/KeyVerificationSelfVerifyStartCoordinatorType.swift b/Riot/Modules/KeyVerification/Device/SelfVerifyStart/KeyVerificationSelfVerifyStartCoordinatorType.swift index faa2a8555..6799602d3 100644 --- a/Riot/Modules/KeyVerification/Device/SelfVerifyStart/KeyVerificationSelfVerifyStartCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Device/SelfVerifyStart/KeyVerificationSelfVerifyStartCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol KeyVerificationSelfVerifyStartCoordinatorDelegate: class { +protocol KeyVerificationSelfVerifyStartCoordinatorDelegate: AnyObject { func keyVerificationSelfVerifyStartCoordinator(_ coordinator: KeyVerificationSelfVerifyStartCoordinatorType, otherDidAcceptRequest request: MXKeyVerificationRequest) diff --git a/Riot/Modules/KeyVerification/Device/SelfVerifyStart/KeyVerificationSelfVerifyStartViewModelType.swift b/Riot/Modules/KeyVerification/Device/SelfVerifyStart/KeyVerificationSelfVerifyStartViewModelType.swift index 0de1eccf5..2f70b5a31 100644 --- a/Riot/Modules/KeyVerification/Device/SelfVerifyStart/KeyVerificationSelfVerifyStartViewModelType.swift +++ b/Riot/Modules/KeyVerification/Device/SelfVerifyStart/KeyVerificationSelfVerifyStartViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol KeyVerificationSelfVerifyStartViewModelViewDelegate: class { +protocol KeyVerificationSelfVerifyStartViewModelViewDelegate: AnyObject { func keyVerificationSelfVerifyStartViewModel(_ viewModel: KeyVerificationSelfVerifyStartViewModelType, didUpdateViewState viewSate: KeyVerificationSelfVerifyStartViewState) } -protocol KeyVerificationSelfVerifyStartViewModelCoordinatorDelegate: class { +protocol KeyVerificationSelfVerifyStartViewModelCoordinatorDelegate: AnyObject { func keyVerificationSelfVerifyStartViewModel(_ viewModel: KeyVerificationSelfVerifyStartViewModelType, otherDidAcceptRequest request: MXKeyVerificationRequest) func keyVerificationSelfVerifyStartViewModelDidCancel(_ viewModel: KeyVerificationSelfVerifyStartViewModelType) } diff --git a/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitCoordinatorType.swift b/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitCoordinatorType.swift index 6c0219c4a..ba1b6c410 100644 --- a/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol KeyVerificationSelfVerifyWaitCoordinatorDelegate: class { +protocol KeyVerificationSelfVerifyWaitCoordinatorDelegate: AnyObject { func keyVerificationSelfVerifyWaitCoordinator(_ coordinator: KeyVerificationSelfVerifyWaitCoordinatorType, didAcceptKeyVerificationRequest keyVerificationRequest: MXKeyVerificationRequest) func keyVerificationSelfVerifyWaitCoordinator(_ coordinator: KeyVerificationSelfVerifyWaitCoordinatorType, didAcceptIncomingSASTransaction incomingSASTransaction: MXIncomingSASTransaction) func keyVerificationSelfVerifyWaitCoordinatorDidCancel(_ coordinator: KeyVerificationSelfVerifyWaitCoordinatorType) diff --git a/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewModelType.swift b/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewModelType.swift index c6fc85ff0..264a73b83 100644 --- a/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewModelType.swift +++ b/Riot/Modules/KeyVerification/Device/SelfVerifyWait/KeyVerificationSelfVerifyWaitViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol KeyVerificationSelfVerifyWaitViewModelViewDelegate: class { +protocol KeyVerificationSelfVerifyWaitViewModelViewDelegate: AnyObject { func keyVerificationSelfVerifyWaitViewModel(_ viewModel: KeyVerificationSelfVerifyWaitViewModelType, didUpdateViewState viewSate: KeyVerificationSelfVerifyWaitViewState) } -protocol KeyVerificationSelfVerifyWaitViewModelCoordinatorDelegate: class { +protocol KeyVerificationSelfVerifyWaitViewModelCoordinatorDelegate: AnyObject { func keyVerificationSelfVerifyWaitViewModel(_ viewModel: KeyVerificationSelfVerifyWaitViewModelType, didAcceptKeyVerificationRequest keyVerificationRequest: MXKeyVerificationRequest) func keyVerificationSelfVerifyWaitViewModel(_ viewModel: KeyVerificationSelfVerifyWaitViewModelType, didAcceptIncomingSASTransaction incomingSASTransaction: MXIncomingSASTransaction) func keyVerificationSelfVerifyWaitViewModelDidCancel(_ viewModel: KeyVerificationSelfVerifyWaitViewModelType) diff --git a/Riot/Modules/KeyVerification/Device/Start/DeviceVerificationStartCoordinatorType.swift b/Riot/Modules/KeyVerification/Device/Start/DeviceVerificationStartCoordinatorType.swift index 72871ee60..16a79760c 100644 --- a/Riot/Modules/KeyVerification/Device/Start/DeviceVerificationStartCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/Device/Start/DeviceVerificationStartCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol DeviceVerificationStartCoordinatorDelegate: class { +protocol DeviceVerificationStartCoordinatorDelegate: AnyObject { func deviceVerificationStartCoordinator(_ coordinator: DeviceVerificationStartCoordinatorType, didCompleteWithOutgoingTransaction transaction: MXSASTransaction) func deviceVerificationStartCoordinator(_ coordinator: DeviceVerificationStartCoordinatorType, didTransactionCancelled transaction: MXSASTransaction) diff --git a/Riot/Modules/KeyVerification/Device/Start/DeviceVerificationStartViewModelType.swift b/Riot/Modules/KeyVerification/Device/Start/DeviceVerificationStartViewModelType.swift index 07da5a197..015e80faf 100644 --- a/Riot/Modules/KeyVerification/Device/Start/DeviceVerificationStartViewModelType.swift +++ b/Riot/Modules/KeyVerification/Device/Start/DeviceVerificationStartViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol DeviceVerificationStartViewModelViewDelegate: class { +protocol DeviceVerificationStartViewModelViewDelegate: AnyObject { func deviceVerificationStartViewModel(_ viewModel: DeviceVerificationStartViewModelType, didUpdateViewState viewSate: DeviceVerificationStartViewState) } -protocol DeviceVerificationStartViewModelCoordinatorDelegate: class { +protocol DeviceVerificationStartViewModelCoordinatorDelegate: AnyObject { func deviceVerificationStartViewModelDidUseLegacyVerification(_ viewModel: DeviceVerificationStartViewModelType) func deviceVerificationStartViewModel(_ viewModel: DeviceVerificationStartViewModelType, didCompleteWithOutgoingTransaction transaction: MXSASTransaction) diff --git a/Riot/Modules/KeyVerification/User/SessionStatus/UserVerificationSessionStatusCoordinatorType.swift b/Riot/Modules/KeyVerification/User/SessionStatus/UserVerificationSessionStatusCoordinatorType.swift index 05d2c73b8..107fa42fa 100644 --- a/Riot/Modules/KeyVerification/User/SessionStatus/UserVerificationSessionStatusCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/User/SessionStatus/UserVerificationSessionStatusCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol UserVerificationSessionStatusCoordinatorDelegate: class { +protocol UserVerificationSessionStatusCoordinatorDelegate: AnyObject { func userVerificationSessionStatusCoordinator(_ coordinator: UserVerificationSessionStatusCoordinatorType, wantsToVerifyDeviceWithId deviceId: String, for userId: String) func userVerificationSessionStatusCoordinator(_ coordinator: UserVerificationSessionStatusCoordinatorType, wantsToManuallyVerifyDeviceWithId deviceId: String, for userId: String) func userVerificationSessionStatusCoordinatorDidClose(_ coordinator: UserVerificationSessionStatusCoordinatorType) diff --git a/Riot/Modules/KeyVerification/User/SessionStatus/UserVerificationSessionStatusViewModelType.swift b/Riot/Modules/KeyVerification/User/SessionStatus/UserVerificationSessionStatusViewModelType.swift index 4598b4fa8..b600e235e 100644 --- a/Riot/Modules/KeyVerification/User/SessionStatus/UserVerificationSessionStatusViewModelType.swift +++ b/Riot/Modules/KeyVerification/User/SessionStatus/UserVerificationSessionStatusViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol UserVerificationSessionStatusViewModelViewDelegate: class { +protocol UserVerificationSessionStatusViewModelViewDelegate: AnyObject { func userVerificationSessionStatusViewModel(_ viewModel: UserVerificationSessionStatusViewModelType, didUpdateViewState viewSate: UserVerificationSessionStatusViewState) } -protocol UserVerificationSessionStatusViewModelCoordinatorDelegate: class { +protocol UserVerificationSessionStatusViewModelCoordinatorDelegate: AnyObject { func userVerificationSessionStatusViewModel(_ viewModel: UserVerificationSessionStatusViewModelType, wantsToVerifyDeviceWithId deviceId: String, for userId: String) func userVerificationSessionStatusViewModel(_ viewModel: UserVerificationSessionStatusViewModelType, wantsToManuallyVerifyDeviceWithId deviceId: String, for userId: String) func userVerificationSessionStatusViewModelDidClose(_ viewModel: UserVerificationSessionStatusViewModelType) diff --git a/Riot/Modules/KeyVerification/User/SessionsStatus/UserVerificationSessionsStatusCoordinatorType.swift b/Riot/Modules/KeyVerification/User/SessionsStatus/UserVerificationSessionsStatusCoordinatorType.swift index 46eccaaa5..67c39e688 100644 --- a/Riot/Modules/KeyVerification/User/SessionsStatus/UserVerificationSessionsStatusCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/User/SessionsStatus/UserVerificationSessionsStatusCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol UserVerificationSessionsStatusCoordinatorDelegate: class { +protocol UserVerificationSessionsStatusCoordinatorDelegate: AnyObject { func userVerificationSessionsStatusCoordinatorDidClose(_ coordinator: UserVerificationSessionsStatusCoordinatorType) func userVerificationSessionsStatusCoordinator(_ coordinator: UserVerificationSessionsStatusCoordinatorType, didSelectDeviceWithId deviceId: String, for userId: String) } diff --git a/Riot/Modules/KeyVerification/User/SessionsStatus/UserVerificationSessionsStatusViewModelType.swift b/Riot/Modules/KeyVerification/User/SessionsStatus/UserVerificationSessionsStatusViewModelType.swift index 4df41221d..fe704b6ad 100644 --- a/Riot/Modules/KeyVerification/User/SessionsStatus/UserVerificationSessionsStatusViewModelType.swift +++ b/Riot/Modules/KeyVerification/User/SessionsStatus/UserVerificationSessionsStatusViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol UserVerificationSessionsStatusViewModelViewDelegate: class { +protocol UserVerificationSessionsStatusViewModelViewDelegate: AnyObject { func userVerificationSessionsStatusViewModel(_ viewModel: UserVerificationSessionsStatusViewModelType, didUpdateViewState viewSate: UserVerificationSessionsStatusViewState) } -protocol UserVerificationSessionsStatusViewModelCoordinatorDelegate: class { +protocol UserVerificationSessionsStatusViewModelCoordinatorDelegate: AnyObject { func userVerificationSessionsStatusViewModel(_ viewModel: UserVerificationSessionsStatusViewModelType, didSelectDeviceWithId deviceId: String, for userId: String) func userVerificationSessionsStatusViewModelDidClose(_ viewModel: UserVerificationSessionsStatusViewModelType) } diff --git a/Riot/Modules/KeyVerification/User/Start/UserVerificationStartCoordinatorType.swift b/Riot/Modules/KeyVerification/User/Start/UserVerificationStartCoordinatorType.swift index ba5c677d9..7f0130b5a 100644 --- a/Riot/Modules/KeyVerification/User/Start/UserVerificationStartCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/User/Start/UserVerificationStartCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol UserVerificationStartCoordinatorDelegate: class { +protocol UserVerificationStartCoordinatorDelegate: AnyObject { func userVerificationStartCoordinator(_ coordinator: UserVerificationStartCoordinatorType, otherDidAcceptRequest request: MXKeyVerificationRequest) diff --git a/Riot/Modules/KeyVerification/User/Start/UserVerificationStartViewModelType.swift b/Riot/Modules/KeyVerification/User/Start/UserVerificationStartViewModelType.swift index 40582e0bf..b84043938 100644 --- a/Riot/Modules/KeyVerification/User/Start/UserVerificationStartViewModelType.swift +++ b/Riot/Modules/KeyVerification/User/Start/UserVerificationStartViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol UserVerificationStartViewModelViewDelegate: class { +protocol UserVerificationStartViewModelViewDelegate: AnyObject { func userVerificationStartViewModel(_ viewModel: UserVerificationStartViewModelType, didUpdateViewState viewSate: UserVerificationStartViewState) } -protocol UserVerificationStartViewModelCoordinatorDelegate: class { +protocol UserVerificationStartViewModelCoordinatorDelegate: AnyObject { func userVerificationStartViewModel(_ viewModel: UserVerificationStartViewModelType, otherDidAcceptRequest request: MXKeyVerificationRequest) diff --git a/Riot/Modules/KeyVerification/User/UserVerificationCoordinatorType.swift b/Riot/Modules/KeyVerification/User/UserVerificationCoordinatorType.swift index feeba8d3b..db665607e 100644 --- a/Riot/Modules/KeyVerification/User/UserVerificationCoordinatorType.swift +++ b/Riot/Modules/KeyVerification/User/UserVerificationCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol UserVerificationCoordinatorDelegate: class { +protocol UserVerificationCoordinatorDelegate: AnyObject { func userVerificationCoordinatorDidComplete(_ coordinator: UserVerificationCoordinatorType) } diff --git a/Riot/Modules/MediaPicker/MediaPickerCoordinatorType.swift b/Riot/Modules/MediaPicker/MediaPickerCoordinatorType.swift index 53f154536..0c8b2bff5 100644 --- a/Riot/Modules/MediaPicker/MediaPickerCoordinatorType.swift +++ b/Riot/Modules/MediaPicker/MediaPickerCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol MediaPickerCoordinatorDelegate: class { +protocol MediaPickerCoordinatorDelegate: AnyObject { func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectImageData imageData: Data, withUTI uti: MXKUTI?) func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectVideoAt url: URL) func mediaPickerCoordinator(_ coordinator: MediaPickerCoordinatorType, didSelectAssets assets: [PHAsset]) diff --git a/Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift b/Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift index f8bc066ee..ca14df785 100644 --- a/Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift +++ b/Riot/Modules/MediaPicker/SingleImagePickerPresenter.swift @@ -18,7 +18,7 @@ import Foundation import UIKit import AVFoundation -@objc protocol SingleImagePickerPresenterDelegate: class { +@objc protocol SingleImagePickerPresenterDelegate: AnyObject { func singleImagePickerPresenter(_ presenter: SingleImagePickerPresenter, didSelectImageData imageData: Data, withUTI uti: MXKUTI?) func singleImagePickerPresenterDidCancel(_ presenter: SingleImagePickerPresenter) } diff --git a/Riot/Modules/QRCode/Reader/QRCodeReaderViewController.swift b/Riot/Modules/QRCode/Reader/QRCodeReaderViewController.swift index 766795d63..4d35af705 100644 --- a/Riot/Modules/QRCode/Reader/QRCodeReaderViewController.swift +++ b/Riot/Modules/QRCode/Reader/QRCodeReaderViewController.swift @@ -17,7 +17,7 @@ import UIKit import ZXingObjC -protocol QRCodeReaderViewControllerDelegate: class { +protocol QRCodeReaderViewControllerDelegate: AnyObject { func qrCodeReaderViewController(_ viewController: QRCodeReaderViewController, didFound payloadData: Data) func qrCodeReaderViewControllerDidCancel(_ viewController: QRCodeReaderViewController) } diff --git a/Riot/Modules/Reauthentication/ReauthenticationCoordinatorType.swift b/Riot/Modules/Reauthentication/ReauthenticationCoordinatorType.swift index bdbc31ce2..96c48215d 100644 --- a/Riot/Modules/Reauthentication/ReauthenticationCoordinatorType.swift +++ b/Riot/Modules/Reauthentication/ReauthenticationCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol ReauthenticationCoordinatorDelegate: class { +protocol ReauthenticationCoordinatorDelegate: AnyObject { func reauthenticationCoordinatorDidComplete(_ coordinator: ReauthenticationCoordinatorType, withAuthenticationParameters: [String: Any]?) func reauthenticationCoordinatorDidCancel(_ coordinator: ReauthenticationCoordinatorType) func reauthenticationCoordinator(_ coordinator: ReauthenticationCoordinatorType, didFailWithError: Error) diff --git a/Riot/Modules/Room/BubbleReactions/BubbleReactionsViewModelType.swift b/Riot/Modules/Room/BubbleReactions/BubbleReactionsViewModelType.swift index e67dcfdbd..77cab862e 100644 --- a/Riot/Modules/Room/BubbleReactions/BubbleReactionsViewModelType.swift +++ b/Riot/Modules/Room/BubbleReactions/BubbleReactionsViewModelType.swift @@ -39,7 +39,7 @@ enum BubbleReactionsViewState { } } -@objc protocol BubbleReactionsViewModelDelegate: class { +@objc protocol BubbleReactionsViewModelDelegate: AnyObject { func bubbleReactionsViewModel(_ viewModel: BubbleReactionsViewModel, didAddReaction reactionCount: MXReactionCount, forEventId eventId: String) func bubbleReactionsViewModel(_ viewModel: BubbleReactionsViewModel, didRemoveReaction reactionCount: MXReactionCount, forEventId eventId: String) func bubbleReactionsViewModel(_ viewModel: BubbleReactionsViewModel, didShowAllTappedForEventId eventId: String) @@ -47,7 +47,7 @@ enum BubbleReactionsViewState { func bubbleReactionsViewModel(_ viewModel: BubbleReactionsViewModel, didLongPressForEventId eventId: String) } -protocol BubbleReactionsViewModelViewDelegate: class { +protocol BubbleReactionsViewModelViewDelegate: AnyObject { func bubbleReactionsViewModel(_ viewModel: BubbleReactionsViewModel, didUpdateViewState viewState: BubbleReactionsViewState) } diff --git a/Riot/Modules/Room/ContextualMenu/ReactionsMenu/ReactionsMenuViewModelType.swift b/Riot/Modules/Room/ContextualMenu/ReactionsMenu/ReactionsMenuViewModelType.swift index fee8b41d9..2171e3ab5 100644 --- a/Riot/Modules/Room/ContextualMenu/ReactionsMenu/ReactionsMenuViewModelType.swift +++ b/Riot/Modules/Room/ContextualMenu/ReactionsMenu/ReactionsMenuViewModelType.swift @@ -16,11 +16,11 @@ import Foundation -protocol ReactionsMenuViewModelViewDelegate: class { +protocol ReactionsMenuViewModelViewDelegate: AnyObject { func reactionsMenuViewModel(_ viewModel: ReactionsMenuViewModel, didUpdateViewState viewState: ReactionsMenuViewState) } -@objc protocol ReactionsMenuViewModelCoordinatorDelegate: class { +@objc protocol ReactionsMenuViewModelCoordinatorDelegate: AnyObject { func reactionsMenuViewModel(_ viewModel: ReactionsMenuViewModel, didAddReaction reaction: String, forEventId eventId: String) func reactionsMenuViewModel(_ viewModel: ReactionsMenuViewModel, didRemoveReaction reaction: String, forEventId eventId: String) func reactionsMenuViewModelDidTapMoreReactions(_ viewModel: ReactionsMenuViewModel, forEventId eventId: String) diff --git a/Riot/Modules/Room/ContextualMenu/RoomContextualMenuViewController.swift b/Riot/Modules/Room/ContextualMenu/RoomContextualMenuViewController.swift index 32052dc06..e236a6ec1 100644 --- a/Riot/Modules/Room/ContextualMenu/RoomContextualMenuViewController.swift +++ b/Riot/Modules/Room/ContextualMenu/RoomContextualMenuViewController.swift @@ -16,7 +16,7 @@ import UIKit -@objc protocol RoomContextualMenuViewControllerDelegate: class { +@objc protocol RoomContextualMenuViewControllerDelegate: AnyObject { func roomContextualMenuViewControllerDidTapBackgroundOverlay(_ viewController: RoomContextualMenuViewController) } diff --git a/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalCoordinatorType.swift b/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalCoordinatorType.swift index 02ff0e62e..0629043b0 100644 --- a/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalCoordinatorType.swift +++ b/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol RoomCreationEventsModalCoordinatorDelegate: class { +protocol RoomCreationEventsModalCoordinatorDelegate: AnyObject { func roomCreationEventsModalCoordinatorDidTapClose(_ coordinator: RoomCreationEventsModalCoordinatorType) } diff --git a/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalViewModelType.swift b/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalViewModelType.swift index 6a670c1f5..5378da659 100644 --- a/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalViewModelType.swift +++ b/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol RoomCreationEventsModalViewModelViewDelegate: class { +protocol RoomCreationEventsModalViewModelViewDelegate: AnyObject { func roomCreationEventsModalViewModel(_ viewModel: RoomCreationEventsModalViewModelType, didUpdateViewState viewSate: RoomCreationEventsModalViewState) } -protocol RoomCreationEventsModalViewModelCoordinatorDelegate: class { +protocol RoomCreationEventsModalViewModelCoordinatorDelegate: AnyObject { func roomCreationEventsModalViewModelDidTapClose(_ viewModel: RoomCreationEventsModalViewModelType) } diff --git a/Riot/Modules/Room/CreationModal/RoomCreationModalCoordinatorType.swift b/Riot/Modules/Room/CreationModal/RoomCreationModalCoordinatorType.swift index 11f3a1c21..f1830a0c1 100644 --- a/Riot/Modules/Room/CreationModal/RoomCreationModalCoordinatorType.swift +++ b/Riot/Modules/Room/CreationModal/RoomCreationModalCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol RoomCreationModalCoordinatorDelegate: class { +protocol RoomCreationModalCoordinatorDelegate: AnyObject { func roomCreationModalCoordinatorDidComplete(_ coordinator: RoomCreationModalCoordinatorType) } diff --git a/Riot/Modules/Room/EditHistory/EditHistoryCoordinatorType.swift b/Riot/Modules/Room/EditHistory/EditHistoryCoordinatorType.swift index 2f02bd705..61788b24b 100644 --- a/Riot/Modules/Room/EditHistory/EditHistoryCoordinatorType.swift +++ b/Riot/Modules/Room/EditHistory/EditHistoryCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol EditHistoryCoordinatorDelegate: class { +protocol EditHistoryCoordinatorDelegate: AnyObject { func editHistoryCoordinatorDidComplete(_ coordinator: EditHistoryCoordinatorType) } diff --git a/Riot/Modules/Room/EditHistory/EditHistoryViewModelType.swift b/Riot/Modules/Room/EditHistory/EditHistoryViewModelType.swift index 4ed9ff707..25d73396d 100644 --- a/Riot/Modules/Room/EditHistory/EditHistoryViewModelType.swift +++ b/Riot/Modules/Room/EditHistory/EditHistoryViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol EditHistoryViewModelViewDelegate: class { +protocol EditHistoryViewModelViewDelegate: AnyObject { func editHistoryViewModel(_ viewModel: EditHistoryViewModelType, didUpdateViewState viewSate: EditHistoryViewState) } -protocol EditHistoryViewModelCoordinatorDelegate: class { +protocol EditHistoryViewModelCoordinatorDelegate: AnyObject { func editHistoryViewModelDidClose(_ viewModel: EditHistoryViewModelType) } diff --git a/Riot/Modules/Room/EmojiPicker/EmojiPickerCoordinatorType.swift b/Riot/Modules/Room/EmojiPicker/EmojiPickerCoordinatorType.swift index e414ea29b..5d99c6118 100644 --- a/Riot/Modules/Room/EmojiPicker/EmojiPickerCoordinatorType.swift +++ b/Riot/Modules/Room/EmojiPicker/EmojiPickerCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol EmojiPickerCoordinatorDelegate: class { +protocol EmojiPickerCoordinatorDelegate: AnyObject { func emojiPickerCoordinator(_ coordinator: EmojiPickerCoordinatorType, didAddEmoji emoji: String, forEventId eventId: String) func emojiPickerCoordinator(_ coordinator: EmojiPickerCoordinatorType, didRemoveEmoji emoji: String, forEventId eventId: String) func emojiPickerCoordinatorDidCancel(_ coordinator: EmojiPickerCoordinatorType) diff --git a/Riot/Modules/Room/EmojiPicker/EmojiPickerViewModelType.swift b/Riot/Modules/Room/EmojiPicker/EmojiPickerViewModelType.swift index 3f15484f1..ba9b44222 100644 --- a/Riot/Modules/Room/EmojiPicker/EmojiPickerViewModelType.swift +++ b/Riot/Modules/Room/EmojiPicker/EmojiPickerViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol EmojiPickerViewModelViewDelegate: class { +protocol EmojiPickerViewModelViewDelegate: AnyObject { func emojiPickerViewModel(_ viewModel: EmojiPickerViewModelType, didUpdateViewState viewSate: EmojiPickerViewState) } -protocol EmojiPickerViewModelCoordinatorDelegate: class { +protocol EmojiPickerViewModelCoordinatorDelegate: AnyObject { func emojiPickerViewModel(_ viewModel: EmojiPickerViewModelType, didAddEmoji emoji: String, forEventId eventId: String) func emojiPickerViewModel(_ viewModel: EmojiPickerViewModelType, didRemoveEmoji emoji: String, forEventId eventId: String) func emojiPickerViewModelDidCancel(_ viewModel: EmojiPickerViewModelType) diff --git a/Riot/Modules/Room/ReactionHistory/ReactionHistoryCoordinatorType.swift b/Riot/Modules/Room/ReactionHistory/ReactionHistoryCoordinatorType.swift index 420dc1fe2..95a5bfbe8 100644 --- a/Riot/Modules/Room/ReactionHistory/ReactionHistoryCoordinatorType.swift +++ b/Riot/Modules/Room/ReactionHistory/ReactionHistoryCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol ReactionHistoryCoordinatorDelegate: class { +protocol ReactionHistoryCoordinatorDelegate: AnyObject { func reactionHistoryCoordinatorDidClose(_ coordinator: ReactionHistoryCoordinatorType) } diff --git a/Riot/Modules/Room/ReactionHistory/ReactionHistoryViewModelType.swift b/Riot/Modules/Room/ReactionHistory/ReactionHistoryViewModelType.swift index 92c300d46..735ee7b16 100644 --- a/Riot/Modules/Room/ReactionHistory/ReactionHistoryViewModelType.swift +++ b/Riot/Modules/Room/ReactionHistory/ReactionHistoryViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol ReactionHistoryViewModelViewDelegate: class { +protocol ReactionHistoryViewModelViewDelegate: AnyObject { func reactionHistoryViewModel(_ viewModel: ReactionHistoryViewModelType, didUpdateViewState viewSate: ReactionHistoryViewState) } -protocol ReactionHistoryViewModelCoordinatorDelegate: class { +protocol ReactionHistoryViewModelCoordinatorDelegate: AnyObject { func reactionHistoryViewModelDidClose(_ viewModel: ReactionHistoryViewModelType) } diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoCoordinatorType.swift b/Riot/Modules/Room/RoomInfo/RoomInfoCoordinatorType.swift index c98c7a751..ff2e04626 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoCoordinatorType.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol RoomInfoCoordinatorDelegate: class { +protocol RoomInfoCoordinatorDelegate: AnyObject { func roomInfoCoordinatorDidComplete(_ coordinator: RoomInfoCoordinatorType) } diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListCoordinatorType.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListCoordinatorType.swift index db953c40b..7979d1aa8 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListCoordinatorType.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol RoomInfoListCoordinatorDelegate: class { +protocol RoomInfoListCoordinatorDelegate: AnyObject { func roomInfoListCoordinator(_ coordinator: RoomInfoListCoordinatorType, wantsToNavigateTo target: RoomInfoListTarget) func roomInfoListCoordinatorDidCancel(_ coordinator: RoomInfoListCoordinatorType) } diff --git a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewModelType.swift b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewModelType.swift index 439624dea..2610d89a2 100644 --- a/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewModelType.swift +++ b/Riot/Modules/Room/RoomInfo/RoomInfoList/RoomInfoListViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol RoomInfoListViewModelViewDelegate: class { +protocol RoomInfoListViewModelViewDelegate: AnyObject { func roomInfoListViewModel(_ viewModel: RoomInfoListViewModelType, didUpdateViewState viewSate: RoomInfoListViewState) } -protocol RoomInfoListViewModelCoordinatorDelegate: class { +protocol RoomInfoListViewModelCoordinatorDelegate: AnyObject { func roomInfoListViewModelDidCancel(_ viewModel: RoomInfoListViewModelType) func roomInfoListViewModel(_ viewModel: RoomInfoListViewModelType, wantsToNavigateTo target: RoomInfoListTarget) } diff --git a/Riot/Modules/Room/Views/RemoveJitsiWidget/RemoveJitsiWidgetViewDelegate.swift b/Riot/Modules/Room/Views/RemoveJitsiWidget/RemoveJitsiWidgetViewDelegate.swift index f48af79a1..6e97db18c 100644 --- a/Riot/Modules/Room/Views/RemoveJitsiWidget/RemoveJitsiWidgetViewDelegate.swift +++ b/Riot/Modules/Room/Views/RemoveJitsiWidget/RemoveJitsiWidgetViewDelegate.swift @@ -17,7 +17,7 @@ import Foundation @objc -protocol RemoveJitsiWidgetViewDelegate: class { +protocol RemoveJitsiWidgetViewDelegate: AnyObject { /// Tells the delegate that the user complete sliding on the view /// - Parameter view: The view instance diff --git a/Riot/Modules/Rooms/RoomsDirectoryCoordinatorType.swift b/Riot/Modules/Rooms/RoomsDirectoryCoordinatorType.swift index a33788a44..40e38c6d4 100644 --- a/Riot/Modules/Rooms/RoomsDirectoryCoordinatorType.swift +++ b/Riot/Modules/Rooms/RoomsDirectoryCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol RoomsDirectoryCoordinatorDelegate: class { +protocol RoomsDirectoryCoordinatorDelegate: AnyObject { func roomsDirectoryCoordinator(_ coordinator: RoomsDirectoryCoordinatorType, didSelectRoom room: MXPublicRoom) func roomsDirectoryCoordinatorDidTapCreateNewRoom(_ coordinator: RoomsDirectoryCoordinatorType) func roomsDirectoryCoordinatorDidComplete(_ coordinator: RoomsDirectoryCoordinatorType) diff --git a/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift b/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift index e072ff350..d6b67472b 100644 --- a/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift +++ b/Riot/Modules/Rooms/ShowDirectory/Cells/Room/DirectoryRoomTableViewCell.swift @@ -17,7 +17,7 @@ import UIKit import Reusable -protocol DirectoryRoomTableViewCellDelegate: class { +protocol DirectoryRoomTableViewCellDelegate: AnyObject { func directoryRoomTableViewCellDidTapJoin(_ cell: DirectoryRoomTableViewCell) } diff --git a/Riot/Modules/Rooms/ShowDirectory/ShowDirectoryCoordinatorType.swift b/Riot/Modules/Rooms/ShowDirectory/ShowDirectoryCoordinatorType.swift index 2290edf48..b46b3ca4f 100644 --- a/Riot/Modules/Rooms/ShowDirectory/ShowDirectoryCoordinatorType.swift +++ b/Riot/Modules/Rooms/ShowDirectory/ShowDirectoryCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol ShowDirectoryCoordinatorDelegate: class { +protocol ShowDirectoryCoordinatorDelegate: AnyObject { func showDirectoryCoordinator(_ coordinator: ShowDirectoryCoordinatorType, didSelectRoom room: MXPublicRoom) func showDirectoryCoordinatorDidTapCreateNewRoom(_ coordinator: ShowDirectoryCoordinatorType) func showDirectoryCoordinatorDidCancel(_ coordinator: ShowDirectoryCoordinatorType) diff --git a/Riot/Modules/Rooms/ShowDirectory/ShowDirectoryViewModelType.swift b/Riot/Modules/Rooms/ShowDirectory/ShowDirectoryViewModelType.swift index 643cf4029..4c4291f99 100644 --- a/Riot/Modules/Rooms/ShowDirectory/ShowDirectoryViewModelType.swift +++ b/Riot/Modules/Rooms/ShowDirectory/ShowDirectoryViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol ShowDirectoryViewModelViewDelegate: class { +protocol ShowDirectoryViewModelViewDelegate: AnyObject { func showDirectoryViewModel(_ viewModel: ShowDirectoryViewModelType, didUpdateViewState viewSate: ShowDirectoryViewState) } -protocol ShowDirectoryViewModelCoordinatorDelegate: class { +protocol ShowDirectoryViewModelCoordinatorDelegate: AnyObject { func showDirectoryViewModelDidSelect(_ viewModel: ShowDirectoryViewModelType, room: MXPublicRoom) func showDirectoryViewModel(_ viewModel: ShowDirectoryViewModelType, didSelectRoomWithIdOrAlias roomIdOrAlias: String) func showDirectoryViewModelDidTapCreateNewRoom(_ viewModel: ShowDirectoryViewModelType) diff --git a/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyCoordinatorType.swift b/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyCoordinatorType.swift index f0a593f99..74b1b41a2 100644 --- a/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyCoordinatorType.swift +++ b/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol SecretsRecoveryWithKeyCoordinatorDelegate: class { +protocol SecretsRecoveryWithKeyCoordinatorDelegate: AnyObject { func secretsRecoveryWithKeyCoordinatorDidRecover(_ coordinator: SecretsRecoveryWithKeyCoordinatorType) func secretsRecoveryWithKeyCoordinatorDidCancel(_ coordinator: SecretsRecoveryWithKeyCoordinatorType) func secretsRecoveryWithKeyCoordinatorWantsToResetSecrets(_ viewModel: SecretsRecoveryWithKeyCoordinatorType) diff --git a/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewModelType.swift b/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewModelType.swift index c747d67ba..b71ffac5d 100644 --- a/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewModelType.swift +++ b/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewModelType.swift @@ -16,11 +16,11 @@ import Foundation -protocol SecretsRecoveryWithKeyViewModelViewDelegate: class { +protocol SecretsRecoveryWithKeyViewModelViewDelegate: AnyObject { func secretsRecoveryWithKeyViewModel(_ viewModel: SecretsRecoveryWithKeyViewModelType, didUpdateViewState viewSate: SecretsRecoveryWithKeyViewState) } -protocol SecretsRecoveryWithKeyViewModelCoordinatorDelegate: class { +protocol SecretsRecoveryWithKeyViewModelCoordinatorDelegate: AnyObject { func secretsRecoveryWithKeyViewModelDidRecover(_ viewModel: SecretsRecoveryWithKeyViewModelType) func secretsRecoveryWithKeyViewModelDidCancel(_ viewModel: SecretsRecoveryWithKeyViewModelType) func secretsRecoveryWithKeyViewModelWantsToResetSecrets(_ viewModel: SecretsRecoveryWithKeyViewModelType) diff --git a/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseCoordinatorType.swift b/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseCoordinatorType.swift index f09c2eb98..3d6d17e4e 100644 --- a/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseCoordinatorType.swift +++ b/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol SecretsRecoveryWithPassphraseCoordinatorDelegate: class { +protocol SecretsRecoveryWithPassphraseCoordinatorDelegate: AnyObject { func secretsRecoveryWithPassphraseCoordinatorDidRecover(_ coordinator: SecretsRecoveryWithPassphraseCoordinatorType) func secretsRecoveryWithPassphraseCoordinatorDoNotKnowPassphrase(_ coordinator: SecretsRecoveryWithPassphraseCoordinatorType) func secretsRecoveryWithPassphraseCoordinatorDidCancel(_ coordinator: SecretsRecoveryWithPassphraseCoordinatorType) diff --git a/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewModelType.swift b/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewModelType.swift index d54ae59f2..d1f1860a9 100644 --- a/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewModelType.swift +++ b/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewModelType.swift @@ -16,11 +16,11 @@ import Foundation -protocol SecretsRecoveryWithPassphraseViewModelViewDelegate: class { +protocol SecretsRecoveryWithPassphraseViewModelViewDelegate: AnyObject { func secretsRecoveryWithPassphraseViewModel(_ viewModel: SecretsRecoveryWithPassphraseViewModelType, didUpdateViewState viewSate: SecretsRecoveryWithPassphraseViewState) } -protocol SecretsRecoveryWithPassphraseViewModelCoordinatorDelegate: class { +protocol SecretsRecoveryWithPassphraseViewModelCoordinatorDelegate: AnyObject { func secretsRecoveryWithPassphraseViewModelDidRecover(_ viewModel: SecretsRecoveryWithPassphraseViewModelType) func secretsRecoveryWithPassphraseViewModelDidCancel(_ viewModel: SecretsRecoveryWithPassphraseViewModelType) func secretsRecoveryWithPassphraseViewModelWantsToRecoverByKey(_ viewModel: SecretsRecoveryWithPassphraseViewModelType) diff --git a/Riot/Modules/Secrets/Recover/SecretsRecoveryCoordinatorType.swift b/Riot/Modules/Secrets/Recover/SecretsRecoveryCoordinatorType.swift index 64b35f203..f7aea9dba 100644 --- a/Riot/Modules/Secrets/Recover/SecretsRecoveryCoordinatorType.swift +++ b/Riot/Modules/Secrets/Recover/SecretsRecoveryCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol SecretsRecoveryCoordinatorDelegate: class { +protocol SecretsRecoveryCoordinatorDelegate: AnyObject { func secretsRecoveryCoordinatorDidRecover(_ coordinator: SecretsRecoveryCoordinatorType) func secretsRecoveryCoordinatorDidCancel(_ coordinator: SecretsRecoveryCoordinatorType) } diff --git a/Riot/Modules/Secrets/Reset/SecretsResetCoordinatorType.swift b/Riot/Modules/Secrets/Reset/SecretsResetCoordinatorType.swift index 6b28912ce..cd33b058a 100644 --- a/Riot/Modules/Secrets/Reset/SecretsResetCoordinatorType.swift +++ b/Riot/Modules/Secrets/Reset/SecretsResetCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol SecretsResetCoordinatorDelegate: class { +protocol SecretsResetCoordinatorDelegate: AnyObject { func secretsResetCoordinatorDidResetSecrets(_ coordinator: SecretsResetCoordinatorType) func secretsResetCoordinatorDidCancel(_ coordinator: SecretsResetCoordinatorType) } diff --git a/Riot/Modules/Secrets/Reset/SecretsResetViewModelType.swift b/Riot/Modules/Secrets/Reset/SecretsResetViewModelType.swift index ce64f4c31..5a5c88077 100644 --- a/Riot/Modules/Secrets/Reset/SecretsResetViewModelType.swift +++ b/Riot/Modules/Secrets/Reset/SecretsResetViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol SecretsResetViewModelViewDelegate: class { +protocol SecretsResetViewModelViewDelegate: AnyObject { func secretsResetViewModel(_ viewModel: SecretsResetViewModelType, didUpdateViewState viewState: SecretsResetViewState) } -protocol SecretsResetViewModelCoordinatorDelegate: class { +protocol SecretsResetViewModelCoordinatorDelegate: AnyObject { func secretsResetViewModel(_ viewModel: SecretsResetViewModelType, needsToAuthenticateWith request: AuthenticatedEndpointRequest) func secretsResetViewModelDidResetSecrets(_ viewModel: SecretsResetViewModelType) func secretsResetViewModelDidCancel(_ viewModel: SecretsResetViewModelType) diff --git a/Riot/Modules/Secrets/Setup/RecoveryKey/SecretsSetupRecoveryKeyCoordinatorType.swift b/Riot/Modules/Secrets/Setup/RecoveryKey/SecretsSetupRecoveryKeyCoordinatorType.swift index 0c2002813..87c885fcd 100644 --- a/Riot/Modules/Secrets/Setup/RecoveryKey/SecretsSetupRecoveryKeyCoordinatorType.swift +++ b/Riot/Modules/Secrets/Setup/RecoveryKey/SecretsSetupRecoveryKeyCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol SecretsSetupRecoveryKeyCoordinatorDelegate: class { +protocol SecretsSetupRecoveryKeyCoordinatorDelegate: AnyObject { func secretsSetupRecoveryKeyCoordinatorDidComplete(_ coordinator: SecretsSetupRecoveryKeyCoordinatorType) func secretsSetupRecoveryKeyCoordinatorDidFailed(_ coordinator: SecretsSetupRecoveryKeyCoordinatorType) func secretsSetupRecoveryKeyCoordinatorDidCancel(_ coordinator: SecretsSetupRecoveryKeyCoordinatorType) diff --git a/Riot/Modules/Secrets/Setup/RecoveryKey/SecretsSetupRecoveryKeyViewModelType.swift b/Riot/Modules/Secrets/Setup/RecoveryKey/SecretsSetupRecoveryKeyViewModelType.swift index 3cf3843d2..0922c9347 100644 --- a/Riot/Modules/Secrets/Setup/RecoveryKey/SecretsSetupRecoveryKeyViewModelType.swift +++ b/Riot/Modules/Secrets/Setup/RecoveryKey/SecretsSetupRecoveryKeyViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol SecretsSetupRecoveryKeyViewModelViewDelegate: class { +protocol SecretsSetupRecoveryKeyViewModelViewDelegate: AnyObject { func secretsSetupRecoveryKeyViewModel(_ viewModel: SecretsSetupRecoveryKeyViewModelType, didUpdateViewState viewSate: SecretsSetupRecoveryKeyViewState) } -protocol SecretsSetupRecoveryKeyViewModelCoordinatorDelegate: class { +protocol SecretsSetupRecoveryKeyViewModelCoordinatorDelegate: AnyObject { func secretsSetupRecoveryKeyViewModelDidComplete(_ viewModel: SecretsSetupRecoveryKeyViewModelType) func secretsSetupRecoveryKeyViewModelDidFailed(_ viewModel: SecretsSetupRecoveryKeyViewModelType) func secretsSetupRecoveryKeyViewModelDidCancel(_ viewModel: SecretsSetupRecoveryKeyViewModelType) diff --git a/Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseCoordinatorType.swift b/Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseCoordinatorType.swift index 4318c4414..a3e3140d0 100644 --- a/Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseCoordinatorType.swift +++ b/Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol SecretsSetupRecoveryPassphraseCoordinatorDelegate: class { +protocol SecretsSetupRecoveryPassphraseCoordinatorDelegate: AnyObject { func secretsSetupRecoveryPassphraseCoordinator(_ coordinator: SecretsSetupRecoveryPassphraseCoordinatorType, didEnterNewPassphrase passphrase: String) func secretsSetupRecoveryPassphraseCoordinator(_ coordinator: SecretsSetupRecoveryPassphraseCoordinatorType, didConfirmPassphrase passphrase: String) func secretsSetupRecoveryPassphraseCoordinatorDidCancel(_ coordinator: SecretsSetupRecoveryPassphraseCoordinatorType) diff --git a/Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseViewModelType.swift b/Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseViewModelType.swift index a7f27ad22..91a3eb50b 100644 --- a/Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseViewModelType.swift +++ b/Riot/Modules/Secrets/Setup/RecoveryPassphrase/SecretsSetupRecoveryPassphraseViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol SecretsSetupRecoveryPassphraseViewModelViewDelegate: class { +protocol SecretsSetupRecoveryPassphraseViewModelViewDelegate: AnyObject { func secretsSetupRecoveryPassphraseViewModel(_ viewModel: SecretsSetupRecoveryPassphraseViewModelType, didUpdateViewState viewSate: SecretsSetupRecoveryPassphraseViewState) } -protocol SecretsSetupRecoveryPassphraseViewModelCoordinatorDelegate: class { +protocol SecretsSetupRecoveryPassphraseViewModelCoordinatorDelegate: AnyObject { func secretsSetupRecoveryPassphraseViewModel(_ viewModel: SecretsSetupRecoveryPassphraseViewModelType, didEnterNewPassphrase passphrase: String) func secretsSetupRecoveryPassphraseViewModel(_ viewModel: SecretsSetupRecoveryPassphraseViewModelType, didConfirmPassphrase passphrase: String) func secretsSetupRecoveryPassphraseViewModelDidCancel(_ viewModel: SecretsSetupRecoveryPassphraseViewModelType) diff --git a/Riot/Modules/SecureBackup/Banners/SecureBackupBannerCell.swift b/Riot/Modules/SecureBackup/Banners/SecureBackupBannerCell.swift index a1ff99449..780689396 100644 --- a/Riot/Modules/SecureBackup/Banners/SecureBackupBannerCell.swift +++ b/Riot/Modules/SecureBackup/Banners/SecureBackupBannerCell.swift @@ -16,7 +16,7 @@ import UIKit -@objc protocol SecureBackupBannerCellDelegate: class { +@objc protocol SecureBackupBannerCellDelegate: AnyObject { func secureBackupBannerCellDidTapCloseAction(_ cell: SecureBackupBannerCell) } diff --git a/Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewController.swift b/Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewController.swift index 0bdd5123c..b95bf6a24 100644 --- a/Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewController.swift +++ b/Riot/Modules/SecureBackup/Setup/Intro/SecureBackupSetupIntroViewController.swift @@ -16,7 +16,7 @@ import UIKit -protocol SecureBackupSetupIntroViewControllerDelegate: class { +protocol SecureBackupSetupIntroViewControllerDelegate: AnyObject { func secureBackupSetupIntroViewControllerDidTapUseKey(_ secureBackupSetupIntroViewController: SecureBackupSetupIntroViewController) func secureBackupSetupIntroViewControllerDidTapUsePassphrase(_ secureBackupSetupIntroViewController: SecureBackupSetupIntroViewController) func secureBackupSetupIntroViewControllerDidCancel(_ secureBackupSetupIntroViewController: SecureBackupSetupIntroViewController, showSkipAlert: Bool) diff --git a/Riot/Modules/SecureBackup/Setup/SecureBackupSetupCoordinatorType.swift b/Riot/Modules/SecureBackup/Setup/SecureBackupSetupCoordinatorType.swift index b4392672f..0ab664999 100644 --- a/Riot/Modules/SecureBackup/Setup/SecureBackupSetupCoordinatorType.swift +++ b/Riot/Modules/SecureBackup/Setup/SecureBackupSetupCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol SecureBackupSetupCoordinatorDelegate: class { +protocol SecureBackupSetupCoordinatorDelegate: AnyObject { func secureBackupSetupCoordinatorDidComplete(_ coordinator: SecureBackupSetupCoordinatorType) func secureBackupSetupCoordinatorDidCancel(_ coordinator: SecureBackupSetupCoordinatorType) } diff --git a/Riot/Modules/ServiceTerms/Modal/Modal/ServiceTermsModalScreenCoordinatorType.swift b/Riot/Modules/ServiceTerms/Modal/Modal/ServiceTermsModalScreenCoordinatorType.swift index ebf6adc6e..909a0b33f 100644 --- a/Riot/Modules/ServiceTerms/Modal/Modal/ServiceTermsModalScreenCoordinatorType.swift +++ b/Riot/Modules/ServiceTerms/Modal/Modal/ServiceTermsModalScreenCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol ServiceTermsModalScreenCoordinatorDelegate: class { +protocol ServiceTermsModalScreenCoordinatorDelegate: AnyObject { func serviceTermsModalScreenCoordinatorDidAccept(_ coordinator: ServiceTermsModalScreenCoordinatorType) func serviceTermsModalScreenCoordinator(_ coordinator: ServiceTermsModalScreenCoordinatorType, displayPolicy policy: MXLoginPolicyData) func serviceTermsModalScreenCoordinatorDidDecline(_ coordinator: ServiceTermsModalScreenCoordinatorType) diff --git a/Riot/Modules/ServiceTerms/Modal/Modal/ServiceTermsModalScreenViewModelType.swift b/Riot/Modules/ServiceTerms/Modal/Modal/ServiceTermsModalScreenViewModelType.swift index 76fff52d3..4dd4b6317 100644 --- a/Riot/Modules/ServiceTerms/Modal/Modal/ServiceTermsModalScreenViewModelType.swift +++ b/Riot/Modules/ServiceTerms/Modal/Modal/ServiceTermsModalScreenViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol ServiceTermsModalScreenViewModelViewDelegate: class { +protocol ServiceTermsModalScreenViewModelViewDelegate: AnyObject { func serviceTermsModalScreenViewModel(_ viewModel: ServiceTermsModalScreenViewModelType, didUpdateViewState viewSate: ServiceTermsModalScreenViewState) } -protocol ServiceTermsModalScreenViewModelCoordinatorDelegate: class { +protocol ServiceTermsModalScreenViewModelCoordinatorDelegate: AnyObject { func serviceTermsModalScreenViewModel(_ coordinator: ServiceTermsModalScreenViewModelType, displayPolicy policy: MXLoginPolicyData) func serviceTermsModalScreenViewModelDidAccept(_ viewModel: ServiceTermsModalScreenViewModelType) func serviceTermsModalScreenViewModelDidDecline(_ viewModel: ServiceTermsModalScreenViewModelType) diff --git a/Riot/Modules/ServiceTerms/Modal/ServiceTermsModalCoordinatorType.swift b/Riot/Modules/ServiceTerms/Modal/ServiceTermsModalCoordinatorType.swift index 84f3386b9..34c09cb18 100644 --- a/Riot/Modules/ServiceTerms/Modal/ServiceTermsModalCoordinatorType.swift +++ b/Riot/Modules/ServiceTerms/Modal/ServiceTermsModalCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol ServiceTermsModalCoordinatorDelegate: class { +protocol ServiceTermsModalCoordinatorDelegate: AnyObject { func serviceTermsModalCoordinatorDidAccept(_ coordinator: ServiceTermsModalCoordinatorType) func serviceTermsModalCoordinatorDidDecline(_ coordinator: ServiceTermsModalCoordinatorType) func serviceTermsModalCoordinatorDidCancel(_ coordinator: ServiceTermsModalCoordinatorType) diff --git a/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeCoordinatorType.swift b/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeCoordinatorType.swift index 873a365bf..fb2a705bc 100644 --- a/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeCoordinatorType.swift +++ b/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol EnterPinCodeCoordinatorDelegate: class { +protocol EnterPinCodeCoordinatorDelegate: AnyObject { func enterPinCodeCoordinatorDidComplete(_ coordinator: EnterPinCodeCoordinatorType) func enterPinCodeCoordinatorDidCompleteWithReset(_ coordinator: EnterPinCodeCoordinatorType, dueToTooManyErrors: Bool) func enterPinCodeCoordinator(_ coordinator: EnterPinCodeCoordinatorType, didCompleteWithPin pin: String) diff --git a/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewModelType.swift b/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewModelType.swift index eb66cdc8c..89d1bf8f1 100644 --- a/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewModelType.swift +++ b/Riot/Modules/SetPinCode/EnterPinCode/EnterPinCodeViewModelType.swift @@ -18,13 +18,13 @@ import Foundation -protocol EnterPinCodeViewModelViewDelegate: class { +protocol EnterPinCodeViewModelViewDelegate: AnyObject { func enterPinCodeViewModel(_ viewModel: EnterPinCodeViewModelType, didUpdateViewState viewSate: EnterPinCodeViewState) func enterPinCodeViewModel(_ viewModel: EnterPinCodeViewModelType, didUpdatePlaceholdersCount count: Int) func enterPinCodeViewModel(_ viewModel: EnterPinCodeViewModelType, didUpdateCancelButtonHidden isHidden: Bool) } -protocol EnterPinCodeViewModelCoordinatorDelegate: class { +protocol EnterPinCodeViewModelCoordinatorDelegate: AnyObject { func enterPinCodeViewModelDidComplete(_ viewModel: EnterPinCodeViewModelType) func enterPinCodeViewModelDidCompleteWithReset(_ viewModel: EnterPinCodeViewModelType, dueToTooManyErrors: Bool) func enterPinCodeViewModel(_ viewModel: EnterPinCodeViewModelType, didCompleteWithPin pin: String) diff --git a/Riot/Modules/SetPinCode/SetPinCoordinatorType.swift b/Riot/Modules/SetPinCode/SetPinCoordinatorType.swift index 3649250b1..ae439b9ee 100644 --- a/Riot/Modules/SetPinCode/SetPinCoordinatorType.swift +++ b/Riot/Modules/SetPinCode/SetPinCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol SetPinCoordinatorDelegate: class { +protocol SetPinCoordinatorDelegate: AnyObject { func setPinCoordinatorDidComplete(_ coordinator: SetPinCoordinatorType) func setPinCoordinatorDidCompleteWithReset(_ coordinator: SetPinCoordinatorType, dueToTooManyErrors: Bool) func setPinCoordinatorDidCancel(_ coordinator: SetPinCoordinatorType) diff --git a/Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsCoordinatorType.swift b/Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsCoordinatorType.swift index 2cd9e9f83..f43d7759a 100644 --- a/Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsCoordinatorType.swift +++ b/Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol SetupBiometricsCoordinatorDelegate: class { +protocol SetupBiometricsCoordinatorDelegate: AnyObject { func setupBiometricsCoordinatorDidComplete(_ coordinator: SetupBiometricsCoordinatorType) func setupBiometricsCoordinatorDidCompleteWithReset(_ coordinator: SetupBiometricsCoordinatorType, dueToTooManyErrors: Bool) func setupBiometricsCoordinatorDidCancel(_ coordinator: SetupBiometricsCoordinatorType) diff --git a/Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsViewModelType.swift b/Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsViewModelType.swift index 2b2708e1d..bd7f3124f 100644 --- a/Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsViewModelType.swift +++ b/Riot/Modules/SetPinCode/SetupBiometrics/SetupBiometricsViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol SetupBiometricsViewModelViewDelegate: class { +protocol SetupBiometricsViewModelViewDelegate: AnyObject { func setupBiometricsViewModel(_ viewModel: SetupBiometricsViewModelType, didUpdateViewState viewSate: SetupBiometricsViewState) } -protocol SetupBiometricsViewModelCoordinatorDelegate: class { +protocol SetupBiometricsViewModelCoordinatorDelegate: AnyObject { func setupBiometricsViewModelDidComplete(_ viewModel: SetupBiometricsViewModelType) func setupBiometricsViewModelDidCompleteWithReset(_ viewModel: SetupBiometricsViewModelType, dueToTooManyErrors: Bool) func setupBiometricsViewModelDidCancel(_ viewModel: SetupBiometricsViewModelType) diff --git a/Riot/Modules/Settings/Discovery/SettingsDiscoveryTableViewSection.swift b/Riot/Modules/Settings/Discovery/SettingsDiscoveryTableViewSection.swift index 0c9116928..6bee0aebe 100644 --- a/Riot/Modules/Settings/Discovery/SettingsDiscoveryTableViewSection.swift +++ b/Riot/Modules/Settings/Discovery/SettingsDiscoveryTableViewSection.swift @@ -16,7 +16,7 @@ import Foundation -@objc protocol SettingsDiscoveryTableViewSectionDelegate: class { +@objc protocol SettingsDiscoveryTableViewSectionDelegate: AnyObject { func settingsDiscoveryTableViewSection(_ settingsDiscoveryTableViewSection: SettingsDiscoveryTableViewSection, tableViewCellClass: MXKTableViewCell.Type, forRow: Int) -> MXKTableViewCell func settingsDiscoveryTableViewSectionDidUpdate(_ settingsDiscoveryTableViewSection: SettingsDiscoveryTableViewSection) diff --git a/Riot/Modules/Settings/Discovery/SettingsDiscoveryViewModelType.swift b/Riot/Modules/Settings/Discovery/SettingsDiscoveryViewModelType.swift index c3ebf4dab..0435a5eb5 100644 --- a/Riot/Modules/Settings/Discovery/SettingsDiscoveryViewModelType.swift +++ b/Riot/Modules/Settings/Discovery/SettingsDiscoveryViewModelType.swift @@ -16,11 +16,11 @@ import Foundation -protocol SettingsDiscoveryViewModelViewDelegate: class { +protocol SettingsDiscoveryViewModelViewDelegate: AnyObject { func settingsDiscoveryViewModel(_ viewModel: SettingsDiscoveryViewModelType, didUpdateViewState viewState: SettingsDiscoveryViewState) } -@objc protocol SettingsDiscoveryViewModelCoordinatorDelegate: class { +@objc protocol SettingsDiscoveryViewModelCoordinatorDelegate: AnyObject { func settingsDiscoveryViewModel(_ viewModel: SettingsDiscoveryViewModel, didSelectThreePidWith medium: String, and address: String) func settingsDiscoveryViewModelDidTapUserSettingsLink(_ viewModel: SettingsDiscoveryViewModel) } diff --git a/Riot/Modules/Settings/Discovery/ThreePidDetails/SettingsDiscoveryThreePidDetailsViewModelType.swift b/Riot/Modules/Settings/Discovery/ThreePidDetails/SettingsDiscoveryThreePidDetailsViewModelType.swift index ce00918fd..df8ccf6f2 100644 --- a/Riot/Modules/Settings/Discovery/ThreePidDetails/SettingsDiscoveryThreePidDetailsViewModelType.swift +++ b/Riot/Modules/Settings/Discovery/ThreePidDetails/SettingsDiscoveryThreePidDetailsViewModelType.swift @@ -18,7 +18,7 @@ import Foundation -protocol SettingsDiscoveryThreePidDetailsViewModelViewDelegate: class { +protocol SettingsDiscoveryThreePidDetailsViewModelViewDelegate: AnyObject { func settingsDiscoveryThreePidDetailsViewModel(_ viewModel: SettingsDiscoveryThreePidDetailsViewModelType, didUpdateViewState viewSate: SettingsDiscoveryThreePidDetailsViewState) } diff --git a/Riot/Modules/Settings/IdentityServer/SettingsIdentityServerViewModelType.swift b/Riot/Modules/Settings/IdentityServer/SettingsIdentityServerViewModelType.swift index 5d8447750..210fcbaef 100644 --- a/Riot/Modules/Settings/IdentityServer/SettingsIdentityServerViewModelType.swift +++ b/Riot/Modules/Settings/IdentityServer/SettingsIdentityServerViewModelType.swift @@ -18,7 +18,7 @@ import Foundation -protocol SettingsIdentityServerViewModelViewDelegate: class { +protocol SettingsIdentityServerViewModelViewDelegate: AnyObject { func settingsIdentityServerViewModel(_ viewModel: SettingsIdentityServerViewModelType, didUpdateViewState viewSate: SettingsIdentityServerViewState) } diff --git a/Riot/Modules/Settings/KeyBackup/SettingsKeyBackupTableViewSection.swift b/Riot/Modules/Settings/KeyBackup/SettingsKeyBackupTableViewSection.swift index d63ce69be..69b64d44f 100644 --- a/Riot/Modules/Settings/KeyBackup/SettingsKeyBackupTableViewSection.swift +++ b/Riot/Modules/Settings/KeyBackup/SettingsKeyBackupTableViewSection.swift @@ -16,7 +16,7 @@ import UIKit -@objc protocol SettingsKeyBackupTableViewSectionDelegate: class { +@objc protocol SettingsKeyBackupTableViewSectionDelegate: AnyObject { func settingsKeyBackupTableViewSectionDidUpdate(_ settingsKeyBackupTableViewSection: SettingsKeyBackupTableViewSection) func settingsKeyBackupTableViewSection(_ settingsKeyBackupTableViewSection: SettingsKeyBackupTableViewSection, textCellForRow: Int) -> MXKTableViewCellWithTextView diff --git a/Riot/Modules/Settings/KeyBackup/SettingsKeyBackupViewModelType.swift b/Riot/Modules/Settings/KeyBackup/SettingsKeyBackupViewModelType.swift index 662462145..191f1b802 100644 --- a/Riot/Modules/Settings/KeyBackup/SettingsKeyBackupViewModelType.swift +++ b/Riot/Modules/Settings/KeyBackup/SettingsKeyBackupViewModelType.swift @@ -16,7 +16,7 @@ import UIKit -protocol SettingsKeyBackupViewModelViewDelegate: class { +protocol SettingsKeyBackupViewModelViewDelegate: AnyObject { func settingsKeyBackupViewModel(_ viewModel: SettingsKeyBackupViewModelType, didUpdateViewState viewState: SettingsKeyBackupViewState) func settingsKeyBackupViewModel(_ viewModel: SettingsKeyBackupViewModelType, didUpdateNetworkRequestViewState networkRequestViewSate: SettingsKeyBackupNetworkRequestViewState) diff --git a/Riot/Modules/Settings/Security/SecureBackup/SettingsSecureBackupTableViewSection.swift b/Riot/Modules/Settings/Security/SecureBackup/SettingsSecureBackupTableViewSection.swift index 6ef387a20..cc23c878c 100644 --- a/Riot/Modules/Settings/Security/SecureBackup/SettingsSecureBackupTableViewSection.swift +++ b/Riot/Modules/Settings/Security/SecureBackup/SettingsSecureBackupTableViewSection.swift @@ -16,7 +16,7 @@ import UIKit -@objc protocol SettingsSecureBackupTableViewSectionDelegate: class { +@objc protocol SettingsSecureBackupTableViewSectionDelegate: AnyObject { // Table view rendering func settingsSecureBackupTableViewSectionDidUpdate(_ settingsSecureBackupTableViewSection: SettingsSecureBackupTableViewSection) diff --git a/Riot/Modules/Settings/Security/SecureBackup/SettingsSecureBackupViewModelType.swift b/Riot/Modules/Settings/Security/SecureBackup/SettingsSecureBackupViewModelType.swift index 4f83b5ccc..4248872dc 100644 --- a/Riot/Modules/Settings/Security/SecureBackup/SettingsSecureBackupViewModelType.swift +++ b/Riot/Modules/Settings/Security/SecureBackup/SettingsSecureBackupViewModelType.swift @@ -16,7 +16,7 @@ import UIKit -protocol SettingsSecureBackupViewModelViewDelegate: class { +protocol SettingsSecureBackupViewModelViewDelegate: AnyObject { func settingsSecureBackupViewModel(_ viewModel: SettingsSecureBackupViewModelType, didUpdateViewState viewState: SettingsSecureBackupViewState) func settingsSecureBackupViewModel(_ viewModel: SettingsSecureBackupViewModelType, didUpdateNetworkRequestViewState networkRequestViewSate: SettingsSecureBackupNetworkRequestViewState) diff --git a/Riot/Modules/Settings/SignOut/SignOutAlertPresenter.swift b/Riot/Modules/Settings/SignOut/SignOutAlertPresenter.swift index faaba6827..0231aef4e 100644 --- a/Riot/Modules/Settings/SignOut/SignOutAlertPresenter.swift +++ b/Riot/Modules/Settings/SignOut/SignOutAlertPresenter.swift @@ -16,7 +16,7 @@ import UIKit -@objc protocol SignOutAlertPresenterDelegate: class { +@objc protocol SignOutAlertPresenterDelegate: AnyObject { func signOutAlertPresenterDidTapSignOutAction(_ presenter: SignOutAlertPresenter) func signOutAlertPresenterDidTapBackupAction(_ presenter: SignOutAlertPresenter) } diff --git a/Riot/Modules/SideMenu/SideMenuActionView.swift b/Riot/Modules/SideMenu/SideMenuActionView.swift index 72ff6a852..689472fc1 100644 --- a/Riot/Modules/SideMenu/SideMenuActionView.swift +++ b/Riot/Modules/SideMenu/SideMenuActionView.swift @@ -17,7 +17,7 @@ import UIKit import Reusable -protocol SideMenuActionViewDelegate: class { +protocol SideMenuActionViewDelegate: AnyObject { func sideMenuActionView(_ actionView: SideMenuActionView, didTapMenuItem sideMenuItem: SideMenuItem?) } diff --git a/Riot/Modules/SideMenu/SideMenuCoordinatorType.swift b/Riot/Modules/SideMenu/SideMenuCoordinatorType.swift index f193c5a73..9223eca59 100644 --- a/Riot/Modules/SideMenu/SideMenuCoordinatorType.swift +++ b/Riot/Modules/SideMenu/SideMenuCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol SideMenuCoordinatorDelegate: class { +protocol SideMenuCoordinatorDelegate: AnyObject { func sideMenuCoordinator(_ coordinator: SideMenuCoordinatorType, didTapMenuItem menuItem: SideMenuItem, fromSourceView sourceView: UIView) } diff --git a/Riot/Modules/SideMenu/SideMenuViewModelType.swift b/Riot/Modules/SideMenu/SideMenuViewModelType.swift index 1ab51f3cf..92479a5ad 100644 --- a/Riot/Modules/SideMenu/SideMenuViewModelType.swift +++ b/Riot/Modules/SideMenu/SideMenuViewModelType.swift @@ -18,11 +18,11 @@ import Foundation -protocol SideMenuViewModelViewDelegate: class { +protocol SideMenuViewModelViewDelegate: AnyObject { func sideMenuViewModel(_ viewModel: SideMenuViewModelType, didUpdateViewState viewSate: SideMenuViewState) } -protocol SideMenuViewModelCoordinatorDelegate: class { +protocol SideMenuViewModelCoordinatorDelegate: AnyObject { func sideMenuViewModel(_ viewModel: SideMenuViewModelType, didTapMenuItem menuItem: SideMenuItem, fromSourceView sourceView: UIView) } diff --git a/Riot/Modules/SlidingModal/SlidingModalContainerView.swift b/Riot/Modules/SlidingModal/SlidingModalContainerView.swift index a494351f2..5a2c6b8d5 100644 --- a/Riot/Modules/SlidingModal/SlidingModalContainerView.swift +++ b/Riot/Modules/SlidingModal/SlidingModalContainerView.swift @@ -17,7 +17,7 @@ import UIKit import Reusable -protocol SlidingModalContainerViewDelegate: class { +protocol SlidingModalContainerViewDelegate: AnyObject { func slidingModalContainerViewDidTapBackground(_ view: SlidingModalContainerView) } diff --git a/Riot/Modules/Spaces/BetaAnnounceCell.swift b/Riot/Modules/Spaces/BetaAnnounceCell.swift index dac6dca86..9897c9417 100644 --- a/Riot/Modules/Spaces/BetaAnnounceCell.swift +++ b/Riot/Modules/Spaces/BetaAnnounceCell.swift @@ -17,7 +17,7 @@ import UIKit import Reusable -@objc protocol BetaAnnounceCellDelegate: class { +@objc protocol BetaAnnounceCellDelegate: AnyObject { func betaAnnounceCellDidTapCloseButton(_ cell: BetaAnnounceCell) } diff --git a/Riot/Modules/SplitView/SplitViewCoordinatorType.swift b/Riot/Modules/SplitView/SplitViewCoordinatorType.swift index 0162e9808..d87138978 100644 --- a/Riot/Modules/SplitView/SplitViewCoordinatorType.swift +++ b/Riot/Modules/SplitView/SplitViewCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol SplitViewCoordinatorDelegate: class { +protocol SplitViewCoordinatorDelegate: AnyObject { // TODO: Remove this method, authentication should not be handled by SplitViewCoordinator func splitViewCoordinatorDidCompleteAuthentication(_ coordinator: SplitViewCoordinatorType) } diff --git a/Riot/Modules/SplitView/SplitViewPresentable.swift b/Riot/Modules/SplitView/SplitViewPresentable.swift index c1bfa2bf7..f09134d3f 100644 --- a/Riot/Modules/SplitView/SplitViewPresentable.swift +++ b/Riot/Modules/SplitView/SplitViewPresentable.swift @@ -16,12 +16,12 @@ import UIKit -protocol SplitViewMasterPresentableDelegate: class { +protocol SplitViewMasterPresentableDelegate: AnyObject { func splitViewMasterPresentable(_ presentable: Presentable, wantsToDisplay detailPresentable: Presentable) } /// Protocol used by the master view presentable of a UISplitViewController -protocol SplitViewMasterPresentable: class, Presentable { +protocol SplitViewMasterPresentable: AnyObject, Presentable { var splitViewMasterPresentableDelegate: SplitViewMasterPresentableDelegate? { get set } diff --git a/Riot/Modules/StartChat/InviteFriendsHeaderView.swift b/Riot/Modules/StartChat/InviteFriendsHeaderView.swift index ceffd0cbb..c1d81ea06 100644 --- a/Riot/Modules/StartChat/InviteFriendsHeaderView.swift +++ b/Riot/Modules/StartChat/InviteFriendsHeaderView.swift @@ -18,7 +18,7 @@ import UIKit import Reusable @objc -protocol InviteFriendsHeaderViewDelegate: class { +protocol InviteFriendsHeaderViewDelegate: AnyObject { func inviteFriendsHeaderView(_ headerView: InviteFriendsHeaderView, didTapButton button: UIButton) } diff --git a/Riot/Modules/TabBar/TabBarCoordinatorType.swift b/Riot/Modules/TabBar/TabBarCoordinatorType.swift index 6cd58a485..50d1cc36e 100644 --- a/Riot/Modules/TabBar/TabBarCoordinatorType.swift +++ b/Riot/Modules/TabBar/TabBarCoordinatorType.swift @@ -18,7 +18,7 @@ import Foundation -protocol TabBarCoordinatorDelegate: class { +protocol TabBarCoordinatorDelegate: AnyObject { // TODO: Remove this method, authentication should not be handled by TabBarCoordinator func tabBarCoordinatorDidCompleteAuthentication(_ coordinator: TabBarCoordinatorType) } diff --git a/Riot/Routers/NavigationRouterType.swift b/Riot/Routers/NavigationRouterType.swift index c32ea4e8e..a04e1f430 100755 --- a/Riot/Routers/NavigationRouterType.swift +++ b/Riot/Routers/NavigationRouterType.swift @@ -18,7 +18,7 @@ import UIKit /// Protocol describing a router that wraps a UINavigationController and add convenient completion handlers. Completions are called when a Presentable is removed. /// Routers are used to be passed between coordinators. They handles only `physical` navigation. -protocol NavigationRouterType: class, Presentable { +protocol NavigationRouterType: AnyObject, Presentable { /// Present modally a view controller on the navigation controller /// diff --git a/Riot/Routers/RootRouterType.swift b/Riot/Routers/RootRouterType.swift index b185b0723..633da610c 100755 --- a/Riot/Routers/RootRouterType.swift +++ b/Riot/Routers/RootRouterType.swift @@ -18,7 +18,7 @@ import UIKit /// Protocol describing a router that wraps the root navigation of the application. /// Routers are used to be passed between coordinators. They handles only `physical` navigation. -protocol RootRouterType: class { +protocol RootRouterType: AnyObject { /// Update the root view controller /// diff --git a/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift b/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift index 4fa5cc5dc..52fff91b7 100644 --- a/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift +++ b/Tools/Templates/buildable/FlowCoordinatorTemplate/FlowTemplateCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol FlowTemplateCoordinatorDelegate: class { +protocol FlowTemplateCoordinatorDelegate: AnyObject { func flowTemplateCoordinatorDidComplete(_ coordinator: FlowTemplateCoordinatorType) } diff --git a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinatorType.swift b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinatorType.swift index 745997b9c..80b3b0730 100644 --- a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinatorType.swift +++ b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenCoordinatorType.swift @@ -16,7 +16,7 @@ import Foundation -protocol TemplateScreenCoordinatorDelegate: class { +protocol TemplateScreenCoordinatorDelegate: AnyObject { func templateScreenCoordinator(_ coordinator: TemplateScreenCoordinatorType, didCompleteWithUserDisplayName userDisplayName: String?) func templateScreenCoordinatorDidCancel(_ coordinator: TemplateScreenCoordinatorType) } diff --git a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModelType.swift b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModelType.swift index fd03254da..e5b5d0163 100644 --- a/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModelType.swift +++ b/Tools/Templates/buildable/ScreenTemplate/TemplateScreenViewModelType.swift @@ -16,11 +16,11 @@ import Foundation -protocol TemplateScreenViewModelViewDelegate: class { +protocol TemplateScreenViewModelViewDelegate: AnyObject { func templateScreenViewModel(_ viewModel: TemplateScreenViewModelType, didUpdateViewState viewSate: TemplateScreenViewState) } -protocol TemplateScreenViewModelCoordinatorDelegate: class { +protocol TemplateScreenViewModelCoordinatorDelegate: AnyObject { func templateScreenViewModel(_ viewModel: TemplateScreenViewModelType, didCompleteWithUserDisplayName userDisplayName: String?) func templateScreenViewModelDidCancel(_ viewModel: TemplateScreenViewModelType) } diff --git a/Tools/Templates/buildable/SimpleScreenTemplate/SimpleScreenTemplateViewController.swift b/Tools/Templates/buildable/SimpleScreenTemplate/SimpleScreenTemplateViewController.swift index 2955714c9..d16519586 100644 --- a/Tools/Templates/buildable/SimpleScreenTemplate/SimpleScreenTemplateViewController.swift +++ b/Tools/Templates/buildable/SimpleScreenTemplate/SimpleScreenTemplateViewController.swift @@ -16,7 +16,7 @@ import UIKit -protocol SimpleScreenTemplateViewControllerDelegate: class { +protocol SimpleScreenTemplateViewControllerDelegate: AnyObject { func simpleScreenTemplateViewControllerDidTapSetupAction(_ viewController: SimpleScreenTemplateViewController) func simpleScreenTemplateViewControllerDidCancel(_ viewController: SimpleScreenTemplateViewController) } From c2900b7dde4dbc314f211d68ca928c943dbb468b Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Fri, 9 Jul 2021 17:58:27 +0100 Subject: [PATCH 57/72] Fix typo in comments. --- .../KeyVerificationVerifyByScanningViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift index f9798806d..49f1a80ca 100644 --- a/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift +++ b/Riot/Modules/KeyVerification/Common/Verify/Scanning/KeyVerificationVerifyByScanningViewController.swift @@ -242,8 +242,8 @@ final class KeyVerificationVerifyByScanningViewController: UIViewController { self.stopQRCodeScanningIfPresented() - // if we're verifying with someone else, let the user know threy cancelled. - // if we're verifying our own device, assume the user probably knows since it them who + // if we're verifying with someone else, let the user know they cancelled. + // if we're verifying our own device, assume the user probably knows since it was them who // cancelled on their other device if verificationKind == .user { self.errorPresenter.presentError(from: self.alertPresentingViewController, title: "", message: VectorL10n.deviceVerificationCancelled, animated: true) { From 1995e321eec9c761b0471d58959ea4b912652526 Mon Sep 17 00:00:00 2001 From: Gil Eluard Date: Fri, 9 Jul 2021 23:54:25 +0200 Subject: [PATCH 58/72] it's easy for the back button to trigger a leftpanel reveal (#4438) - Fixed --- Riot/Modules/TabBar/TabBarCoordinator.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Riot/Modules/TabBar/TabBarCoordinator.swift b/Riot/Modules/TabBar/TabBarCoordinator.swift index 0efc1c03c..cb28c4427 100644 --- a/Riot/Modules/TabBar/TabBarCoordinator.swift +++ b/Riot/Modules/TabBar/TabBarCoordinator.swift @@ -245,9 +245,9 @@ final class TabBarCoordinator: NSObject, TabBarCoordinatorType { } private func setupSideMenuGestures() { - self.parameters.appNavigator.sideMenu.addScreenEdgePanGesturesToPresent(to: self.masterNavigationController.view) - - self.parameters.appNavigator.sideMenu.addPanGestureToPresent(to: self.masterNavigationController.navigationBar) + if let rootViewController = self.masterNavigationController.viewControllers.first { + self.parameters.appNavigator.sideMenu.addScreenEdgePanGesturesToPresent(to: rootViewController.view) + } } // MARK: Navigation From df9e154ddad79337cb52cfba2c4a964d63270c87 Mon Sep 17 00:00:00 2001 From: Gil Eluard Date: Fri, 9 Jul 2021 23:57:34 +0200 Subject: [PATCH 59/72] it's easy for the back button to trigger a leftpanel reveal (#4438) - Updated CHANGES.rst --- Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme b/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme index 84ecb908a..a9bea1d96 100644 --- a/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme +++ b/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme @@ -4,7 +4,8 @@ version = "1.3"> + buildImplicitDependencies = "YES" + runPostActionsOnFailure = "NO"> Date: Fri, 9 Jul 2021 23:58:32 +0200 Subject: [PATCH 60/72] it's easy for the back button to trigger a leftpanel reveal (#4438) - Updated CHANGES.rst --- CHANGES.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index e62d281e9..65744cf74 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -13,7 +13,8 @@ Changes to be released in next version * Fix crash on Apple Silicon Macs. * Media Picker: Generate video thumbnails with the correct orientation (#4515). * Directory List (pop-up one): Fix duplicate rooms being shown (#4537). - * Use different title for scan button for self verification (#4525) + * Use different title for scan button for self verification (#4525). + * it's easy for the back button to trigger a leftpanel reveal (#4438). ⚠️ API Changes * From c57f4e40dc9751a7cb96757a6212ed00474e5c03 Mon Sep 17 00:00:00 2001 From: Gil Eluard Date: Sat, 10 Jul 2021 00:01:47 +0200 Subject: [PATCH 61/72] it's easy for the back button to trigger a leftpanel reveal (#4438) - Reverted Riot.xcscheme --- Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme b/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme index a9bea1d96..84ecb908a 100644 --- a/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme +++ b/Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme @@ -4,8 +4,7 @@ version = "1.3"> + buildImplicitDependencies = "YES"> Date: Mon, 12 Jul 2021 14:02:29 +0100 Subject: [PATCH 62/72] Use updated methods in MatrixKit. --- Riot/Modules/Room/DataSources/RoomDataSource.m | 2 +- Riot/Modules/Room/RoomViewController.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Riot/Modules/Room/DataSources/RoomDataSource.m b/Riot/Modules/Room/DataSources/RoomDataSource.m index 8cd789153..230d313ce 100644 --- a/Riot/Modules/Room/DataSources/RoomDataSource.m +++ b/Riot/Modules/Room/DataSources/RoomDataSource.m @@ -890,7 +890,7 @@ const CGFloat kTypingCellHeight = 24; AVURLAsset *videoAsset = [AVURLAsset assetWithURL:videoLocalURL]; UIImage *videoThumbnail = [MXKVideoThumbnailGenerator.shared generateThumbnailFrom:videoLocalURL]; - [self sendVideo:videoAsset withThumbnail:videoThumbnail success:success failure:failure]; + [self sendVideoAsset:videoAsset withThumbnail:videoThumbnail success:success failure:failure]; } - (void)acceptVerificationRequestForEventId:(NSString*)eventId success:(void(^)(void))success failure:(void(^)(NSError*))failure diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 03f224687..fbd8a25f0 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -6057,7 +6057,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; if (roomInputToolbarView) { AVURLAsset *selectedVideo = [AVURLAsset assetWithURL:url]; - [roomInputToolbarView sendSelectedVideo:selectedVideo isPhotoLibraryAsset:NO]; + [roomInputToolbarView sendSelectedVideoAsset:selectedVideo isPhotoLibraryAsset:NO]; } } @@ -6089,7 +6089,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05; RoomInputToolbarView *roomInputToolbarView = [self inputToolbarViewAsRoomInputToolbarView]; if (roomInputToolbarView) { - [roomInputToolbarView sendSelectedVideo:videoAsset isPhotoLibraryAsset:YES]; + [roomInputToolbarView sendSelectedVideoAsset:videoAsset isPhotoLibraryAsset:YES]; } } From 3ddc562fa7f5f1cbcb5953872f5050915ed0bebb Mon Sep 17 00:00:00 2001 From: Gil Eluard Date: Mon, 12 Jul 2021 22:51:56 +0200 Subject: [PATCH 63/72] Show / hide reset button in secrets recovery screen (#4546). --- CHANGES.rst | 1 + Config/BuildSettings.swift | 5 ++++- Riot/Managers/Settings/RiotSettings.swift | 16 +++++++++++++++- .../SecretsRecoveryWithKeyViewController.swift | 2 ++ ...etsRecoveryWithPassphraseViewController.swift | 2 ++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2dd3d4f43..1933d2510 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -16,6 +16,7 @@ Changes to be released in next version * Directory List (pop-up one): Fix duplicate rooms being shown (#4537). * Use different title for scan button for self verification (#4525). * it's easy for the back button to trigger a leftpanel reveal (#4438). + * Show / hide reset button in secrets recovery screen (#4546). ⚠️ API Changes * diff --git a/Config/BuildSettings.swift b/Config/BuildSettings.swift index 0d5ae6dae..19c2ec733 100644 --- a/Config/BuildSettings.swift +++ b/Config/BuildSettings.swift @@ -321,6 +321,9 @@ final class BuildSettings: NSObject { static let authScreenShowForgotPassword = true static let authScreenShowCustomServerOptions = true - // Mark: - Unified Search + // MARK: - Unified Search static let unifiedSearchScreenShowPublicDirectory = true + + // MARK: - Secrets Recovery + static let secretsRecoveryAllowReset = true } diff --git a/Riot/Managers/Settings/RiotSettings.swift b/Riot/Managers/Settings/RiotSettings.swift index 533702c2b..5a6817aca 100644 --- a/Riot/Managers/Settings/RiotSettings.swift +++ b/Riot/Managers/Settings/RiotSettings.swift @@ -80,6 +80,7 @@ final class RiotSettings: NSObject { static let roomMemberScreenShowIgnore = "roomMemberScreenShowIgnore" static let unifiedSearchScreenShowPublicDirectory = "unifiedSearchScreenShowPublicDirectory" static let hideSpaceBetaAnnounce = "hideSpaceBetaAnnounce" + static let secretsRecoveryAllowReset = "secretsRecoveryAllowReset" } static let shared = RiotSettings() @@ -695,7 +696,7 @@ final class RiotSettings: NSObject { } } - // Mark: - Unified Search + // MARK: - Unified Search var unifiedSearchScreenShowPublicDirectory: Bool { get { @@ -708,6 +709,19 @@ final class RiotSettings: NSObject { } } + // MARK: - Secrets Recovery + + var secretsRecoveryAllowReset: Bool { + get { + guard defaults.object(forKey: UserDefaultsKeys.secretsRecoveryAllowReset) != nil else { + return BuildSettings.secretsRecoveryAllowReset + } + return defaults.bool(forKey: UserDefaultsKeys.secretsRecoveryAllowReset) + } set { + defaults.set(newValue, forKey: UserDefaultsKeys.secretsRecoveryAllowReset) + } + } + // MARK: - Beta var hideSpaceBetaAnnounce: Bool { diff --git a/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift b/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift index a0cc96d35..911f08302 100644 --- a/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift +++ b/Riot/Modules/Secrets/Recover/RecoverWithKey/SecretsRecoveryWithKeyViewController.swift @@ -123,6 +123,8 @@ final class SecretsRecoveryWithKeyViewController: UIViewController { self.updateRecoverButton() self.resetSecretsButton.vc_enableMultiLinesTitle() + + self.resetSecretsButton.isHidden = !RiotSettings.shared.secretsRecoveryAllowReset } private func update(theme: Theme) { diff --git a/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift b/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift index c1fcaaec4..5c64fd51b 100644 --- a/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift +++ b/Riot/Modules/Secrets/Recover/RecoverWithPassphrase/SecretsRecoveryWithPassphraseViewController.swift @@ -125,6 +125,8 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController { self.updateRecoverButton() self.resetSecretsButton.vc_enableMultiLinesTitle() + + self.resetSecretsButton.isHidden = !RiotSettings.shared.secretsRecoveryAllowReset } private func update(theme: Theme) { From caea8a936b27a49253985c2370153ea8e2d901ae Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Tue, 13 Jul 2021 09:32:38 +0100 Subject: [PATCH 64/72] Update CHANGES.rst --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2dd3d4f43..fdf9d4b32 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -27,7 +27,7 @@ Changes to be released in next version * Others - * + * Silenced some documentation, deprecations and SwiftLint warnings. Changes in 1.4.4 (2021-06-30) ================================================= From 7f0f419d675885d654c06a6e4b2df9e4a320b0d2 Mon Sep 17 00:00:00 2001 From: Doug Date: Tue, 13 Jul 2021 16:54:30 +0100 Subject: [PATCH 65/72] Fix layout bug in the share extension. --- .../Modules/Share/Listing/RoomsListViewController.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.m b/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.m index 777249a6e..94acaa453 100644 --- a/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.m +++ b/RiotShareExtension/Modules/Share/Listing/RoomsListViewController.m @@ -129,6 +129,13 @@ } } +- (void)setKeyboardHeight:(CGFloat)keyboardHeight +{ + // Bypass inherited keyboard handling to fix layout when searching. + // There are no sticky headers to worry about updating. + return; +} + #pragma mark - Private - (void)showShareAlertForRoomPath:(NSIndexPath *)indexPath @@ -289,6 +296,12 @@ // Refresh display [self refreshRecentsTable]; } + + // Dismiss the keyboard when scrolling to match the behaviour of the main app. + if (self.recentsSearchBar.isFirstResponder) + { + [self.recentsSearchBar resignFirstResponder]; + } } } } From 3d900e3068c65b06f9e5c1c1409dbda183208948 Mon Sep 17 00:00:00 2001 From: Doug Date: Tue, 13 Jul 2021 17:08:48 +0100 Subject: [PATCH 66/72] Update CHANGES.rst. --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 2e72d9c8e..75dccc3c1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,7 +8,7 @@ Changes to be released in next version * 🐛 Bugfix - * + * Share Extension: Fix layout when searching (#4258). ⚠️ API Changes * From 651f424d67dafd5daa9e0b7a3d581c6e79b6e306 Mon Sep 17 00:00:00 2001 From: TheBlueKingLP <*@tbk.gg> Date: Mon, 12 Jul 2021 15:38:45 +0000 Subject: [PATCH 67/72] Translated using Weblate (Japanese) Currently translated at 91.4% (32 of 35 strings) Translation: Element iOS/Element iOS (Push) Translate-URL: https://translate.element.io/projects/riot-ios/riot-ios-push/ja/ --- Riot/Assets/ja.lproj/Localizable.strings | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Riot/Assets/ja.lproj/Localizable.strings b/Riot/Assets/ja.lproj/Localizable.strings index 51a5c3d85..a2cbb08e6 100644 --- a/Riot/Assets/ja.lproj/Localizable.strings +++ b/Riot/Assets/ja.lproj/Localizable.strings @@ -50,3 +50,27 @@ "SINGLE_UNREAD_IN_ROOM" = "%@にメッセージを受け取りました"; /* A single unread message */ "SINGLE_UNREAD" = "あなたはメッセージを受け取りました"; + +/** Key verification **/ + +"KEY_VERIFICATION_REQUEST_FROM_USER" = "%@は検証したい"; + +/* New message indicator on a room */ +"MESSAGE_IN_X" = "%@ 内のメッセージ"; + +/* Sticker from a specific person, not referencing a room. */ +"STICKER_FROM_USER" = "%@ さんからのスタンプ"; +/* Message title for a specific person in a named room */ +"MSG_FROM_USER_IN_ROOM_TITLE" = "%@(%@ から)"; + +/* Group call from user, CallKit caller name */ +"GROUP_CALL_FROM_USER" = "%@ (グループ通話)"; +"MESSAGE_PROTECTED" = "新しいメッセージ"; + +/* New message indicator from a DM */ +"MESSAGE_FROM_X" = "%@ からのメッセージ"; + +/** Notification messages **/ + +/* New message indicator on unknown room */ +"MESSAGE" = "メッセージ"; From fa1bbecf26d0edf6311ab8298ad2f85a10dabce0 Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 14 Jul 2021 10:15:50 +0100 Subject: [PATCH 68/72] Always update the path of the attachmentView's mask to handle reuse. --- CHANGES.rst | 1 + Riot/Modules/Room/DataSources/RoomDataSource.m | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index bc28f2c30..4f9ab91a1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -17,6 +17,7 @@ Changes to be released in next version * Use different title for scan button for self verification (#4525). * it's easy for the back button to trigger a leftpanel reveal (#4438). * Show / hide reset button in secrets recovery screen (#4546). + * Timeline: Fix incorrect crop of media thumbnails. ⚠️ API Changes * diff --git a/Riot/Modules/Room/DataSources/RoomDataSource.m b/Riot/Modules/Room/DataSources/RoomDataSource.m index 230d313ce..6ab7ec1bf 100644 --- a/Riot/Modules/Room/DataSources/RoomDataSource.m +++ b/Riot/Modules/Room/DataSources/RoomDataSource.m @@ -1039,10 +1039,21 @@ const CGFloat kTypingCellHeight = 24; - (void)applyMaskToAttachmentViewOfBubbleCell:(MXKRoomBubbleTableViewCell *)cell { - if (cell.attachmentView && !cell.attachmentView.layer.mask) + if (cell.attachmentView) { UIBezierPath *myClippingPath = [UIBezierPath bezierPathWithRoundedRect:cell.attachmentView.bounds cornerRadius:6]; - CAShapeLayer *mask = [CAShapeLayer layer]; + CAShapeLayer *mask; + + // check for an existing mask in case the cell is being reused, otherwise create a new one + if ([cell.attachmentView.layer.mask isKindOfClass:[CAShapeLayer class]]) + { + mask = (CAShapeLayer*)cell.attachmentView.layer.mask; + } + else + { + mask = [CAShapeLayer layer]; + } + mask.path = myClippingPath.CGPath; cell.attachmentView.layer.mask = mask; } From 445db8ba78128f91436c9efc5ee44b62708559a3 Mon Sep 17 00:00:00 2001 From: Doug Date: Wed, 14 Jul 2021 10:37:54 +0100 Subject: [PATCH 69/72] Use the layer's corner radius rather than a custom mask. This will ensure the mask bounds always match the view's size. --- Riot/Modules/Room/DataSources/RoomDataSource.m | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Riot/Modules/Room/DataSources/RoomDataSource.m b/Riot/Modules/Room/DataSources/RoomDataSource.m index 6ab7ec1bf..434aee6ac 100644 --- a/Riot/Modules/Room/DataSources/RoomDataSource.m +++ b/Riot/Modules/Room/DataSources/RoomDataSource.m @@ -1041,21 +1041,8 @@ const CGFloat kTypingCellHeight = 24; { if (cell.attachmentView) { - UIBezierPath *myClippingPath = [UIBezierPath bezierPathWithRoundedRect:cell.attachmentView.bounds cornerRadius:6]; - CAShapeLayer *mask; - - // check for an existing mask in case the cell is being reused, otherwise create a new one - if ([cell.attachmentView.layer.mask isKindOfClass:[CAShapeLayer class]]) - { - mask = (CAShapeLayer*)cell.attachmentView.layer.mask; - } - else - { - mask = [CAShapeLayer layer]; - } - - mask.path = myClippingPath.CGPath; - cell.attachmentView.layer.mask = mask; + cell.attachmentView.layer.cornerRadius = 6; + cell.attachmentView.layer.masksToBounds = YES; } } From 4f9b05492e02893f85df5b698f0741dd3a8c92a2 Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Thu, 15 Jul 2021 20:11:39 +0200 Subject: [PATCH 70/72] Changes: Restore 1.4.5 changes. --- CHANGES.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 3bb978f30..bdb4f7f03 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -31,6 +31,30 @@ Changes to be released in next version Others * Silenced some documentation, deprecations and SwiftLint warnings. + +Changes in 1.4.5 (2021-07-07) +================================================= + +✨ Features + * + +🙌 Improvements + * + +🐛 Bugfix + * Notifications: Fix an issue where the app is unresponsive after getting some notifications (#4534). + +⚠️ API Changes + * + +🗣 Translations + * + +🧱 Build + * + +Others + * Changes in 1.4.4 (2021-06-30) ================================================= From 6af882ac4c3bbd4a7c98bbf1e91af3658880245e Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Fri, 16 Jul 2021 15:13:45 +0200 Subject: [PATCH 71/72] version++ --- CHANGES.rst | 5 ++++- Config/AppIdentifiers.xcconfig | 4 ++-- Podfile | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index bdb4f7f03..8b6537681 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,4 +1,4 @@ -Changes to be released in next version +Changes in 1.4.6 (2021-07-16) ================================================= ✨ Features @@ -32,6 +32,9 @@ Changes to be released in next version Others * Silenced some documentation, deprecations and SwiftLint warnings. +Improvements: + * Upgrade MatrixKit version ([v0.15.4](https://github.com/matrix-org/matrix-ios-kit/releases/tag/v0.15.4)). + Changes in 1.4.5 (2021-07-07) ================================================= diff --git a/Config/AppIdentifiers.xcconfig b/Config/AppIdentifiers.xcconfig index 391931749..758906cac 100644 --- a/Config/AppIdentifiers.xcconfig +++ b/Config/AppIdentifiers.xcconfig @@ -22,8 +22,8 @@ APPLICATION_GROUP_IDENTIFIER = group.im.vector APPLICATION_SCHEME = element // Version -MARKETING_VERSION = 1.4.5 -CURRENT_PROJECT_VERSION = 1.4.5 +MARKETING_VERSION = 1.4.6 +CURRENT_PROJECT_VERSION = 1.4.6 // Team diff --git a/Podfile b/Podfile index d008c31f2..2c4471394 100644 --- a/Podfile +++ b/Podfile @@ -11,7 +11,7 @@ use_frameworks! # - `{ {kit spec hash} => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for each repo. Used by Fastfile during CI # # Warning: our internal tooling depends on the name of this variable name, so be sure not to change it -$matrixKitVersion = '= 0.15.3' +$matrixKitVersion = '= 0.15.4' # $matrixKitVersion = :local # $matrixKitVersion = {'develop' => 'develop'} From 158eab81ddfcb270ff985efa2e58dcb340c93fb4 Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Fri, 16 Jul 2021 16:59:24 +0200 Subject: [PATCH 72/72] finish version++ --- Podfile.lock | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 8c6193dfa..8b171f979 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -56,29 +56,29 @@ PODS: - MatomoTracker (7.4.1): - MatomoTracker/Core (= 7.4.1) - MatomoTracker/Core (7.4.1) - - MatrixKit (0.15.3): + - MatrixKit (0.15.4): - Down (~> 0.11.0) - DTCoreText (~> 1.6.25) - HPGrowingTextView (~> 1.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixKit/Core (= 0.15.3) - - MatrixSDK (= 0.19.3) - - MatrixKit/Core (0.15.3): + - MatrixKit/Core (= 0.15.4) + - MatrixSDK (= 0.19.4) + - MatrixKit/Core (0.15.4): - Down (~> 0.11.0) - DTCoreText (~> 1.6.25) - HPGrowingTextView (~> 1.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixSDK (= 0.19.3) - - MatrixSDK (0.19.3): - - MatrixSDK/Core (= 0.19.3) - - MatrixSDK/Core (0.19.3): + - MatrixSDK (= 0.19.4) + - MatrixSDK (0.19.4): + - MatrixSDK/Core (= 0.19.4) + - MatrixSDK/Core (0.19.4): - AFNetworking (~> 4.0.0) - GZIP (~> 1.3.0) - libbase58 (~> 0.1.4) - OLMKit (~> 3.2.4) - Realm (= 10.7.6) - SwiftyBeaver (= 1.9.5) - - MatrixSDK/JingleCallStack (0.19.3): + - MatrixSDK/JingleCallStack (0.19.4): - JitsiMeetSDK (= 3.5.0) - MatrixSDK/Core - OLMKit (3.2.4): @@ -120,7 +120,7 @@ DEPENDENCIES: - KeychainAccess (~> 4.2.2) - KTCenterFlowLayout (~> 1.3.1) - MatomoTracker (~> 7.4.1) - - MatrixKit (= 0.15.3) + - MatrixKit (= 0.15.4) - MatrixSDK - MatrixSDK/JingleCallStack - OLMKit @@ -196,8 +196,8 @@ SPEC CHECKSUMS: LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d Logging: beeb016c9c80cf77042d62e83495816847ef108b MatomoTracker: 24a846c9d3aa76933183fe9d47fd62c9efa863fb - MatrixKit: 6cbe65db11a5450ec8cc02d51660f43b5e95a141 - MatrixSDK: c15663c67bfd2991d897d973c1551ba4de900e25 + MatrixKit: 477690d6dd38b1526042f8e83ff34e3db87e3a00 + MatrixSDK: 0c9d1845a45d71abcfcabe82b706cadbda1297ae OLMKit: 2d73cd67d149b5c3e3a8eb8ecae93d0b429d8a02 ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d Realm: ed860452717c8db8f4bf832b6807f7f2ce708839 @@ -211,6 +211,6 @@ SPEC CHECKSUMS: zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: c39d88adc5ec2df412af32b64ceb99a9a1ee92a8 +PODFILE CHECKSUM: 2b61b852a5b62fbb75643a30281e362fd4566f12 COCOAPODS: 1.10.1