mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
Swift
36 lines
1.1 KiB
Swift
//
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
import SignalServiceKit
|
|
|
|
@objc
|
|
public class SAENotificationsManager: NSObject, NotificationsProtocol {
|
|
|
|
@objc
|
|
override public required init() {
|
|
AssertIsOnMainThread()
|
|
|
|
super.init()
|
|
|
|
SwiftSingletons.register(self)
|
|
}
|
|
|
|
@objc
|
|
public func notifyUser(for incomingMessage: TSIncomingMessage!, in thread: TSThread!, contactsManager: ContactsManagerProtocol!, transaction: YapDatabaseReadTransaction!) {
|
|
owsFail("\(self.logTag) in \(#function).")
|
|
}
|
|
|
|
@objc
|
|
public func notifyUser(for error: TSErrorMessage!, in thread: TSThread!) {
|
|
Logger.error("\(self.logTag) in \(#function).")
|
|
guard let message = NotificationUtils.alertMessage(forErrorMessage: error, inThread: thread, notificationType: .namePreview) else {
|
|
owsFail("\(self.logTag) in \(#function).")
|
|
return
|
|
}
|
|
OWSAlerts.showAlert(withTitle: NSLocalizedString("ALERT_ERROR_TITLE",
|
|
comment: ""),
|
|
message: message)
|
|
}
|
|
}
|