Fix build, mute bug and footer label on unencrypted builds

This commit is contained in:
langleyd
2021-07-06 11:38:29 +01:00
parent 0fb949b294
commit 97496f93ea
4 changed files with 14 additions and 12 deletions
@@ -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)
}
@@ -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
}
}
@@ -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 }
}