Respond to CR. Rework how CallNotificationsAdapter adaptee is populated.

pull/1/head
Matthew Chen 7 years ago
parent edcedd2845
commit a7a05e9bbf

@ -10,20 +10,18 @@ import Foundation
@objc(OWSCallNotificationsAdapter)
public class CallNotificationsAdapter: NSObject {
let adaptee: OWSCallNotificationsAdaptee
@objc public init(adaptee: OWSCallNotificationsAdaptee) {
// TODO We can't mix UILocalNotification (NotificationManager) with the UNNotifications
var adaptee: OWSCallNotificationsAdaptee {
// TODO: We may eventually want to use UserNotificationsAdaptee instead.
//
// We can't mix UILocalNotification (NotificationManager) with the UNNotifications
// Because registering message categories in one, clobbers the registered categories from the other
// We have to first port *all* the existing UINotification categories to UNNotifications
// which is a good thing to do, but in trying to limit the scope of changes that's been
// which is a good thing to do, but in trying to limit the scope of changes that's been
// left out for now.
// if #available(iOS 10.0, *) {
// adaptee = UserNotificationsAdaptee()
// } else {
self.adaptee = adaptee
// }
return SignalApp.shared().notificationsManager
}
@objc public override init() {
super.init()
SwiftSingletons.register(self)

@ -73,11 +73,10 @@ NS_ASSUME_NONNULL_BEGIN
selector:@selector(didChangeCallLoggingPreference:)
name:OWSPreferencesCallLoggingDidChangeNotification
object:nil];
_callService = [[CallService alloc]
initWithAccountManager:self.accountManager
contactsManager:Environment.shared.contactsManager
messageSender:SSKEnvironment.shared.messageSender
notificationsAdapter:[[OWSCallNotificationsAdapter alloc] initWithAdaptee:self.notificationsManager]];
_callService = [[CallService alloc] initWithAccountManager:self.accountManager
contactsManager:Environment.shared.contactsManager
messageSender:SSKEnvironment.shared.messageSender
notificationsAdapter:[OWSCallNotificationsAdapter new]];
_callMessageHandler =
[[OWSWebRTCCallMessageHandler alloc] initWithAccountManager:self.accountManager

Loading…
Cancel
Save