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) @objc(OWSCallNotificationsAdapter)
public class CallNotificationsAdapter: NSObject { public class CallNotificationsAdapter: NSObject {
let adaptee: OWSCallNotificationsAdaptee var adaptee: OWSCallNotificationsAdaptee {
// TODO: We may eventually want to use UserNotificationsAdaptee instead.
@objc public init(adaptee: OWSCallNotificationsAdaptee) { //
// TODO We can't mix UILocalNotification (NotificationManager) with the UNNotifications // We can't mix UILocalNotification (NotificationManager) with the UNNotifications
// Because registering message categories in one, clobbers the registered categories from the other // 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 // 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. // left out for now.
// if #available(iOS 10.0, *) { return SignalApp.shared().notificationsManager
// adaptee = UserNotificationsAdaptee() }
// } else {
self.adaptee = adaptee
// }
@objc public override init() {
super.init() super.init()
SwiftSingletons.register(self) SwiftSingletons.register(self)

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

Loading…
Cancel
Save