Merge branch 'mkirk/safer-call-connect-fix' into release/2.21.0

pull/1/head
Michael Kirk 7 years ago
commit 218623bbb3

@ -1063,9 +1063,6 @@ static NSString *const kURLHostVerifyPrefix = @"verify";
// TODO: Once "app ready" logic is moved into AppSetup, move this line there.
[[OWSProfileManager sharedManager] ensureLocalProfileCached];
// Incase anything changed while migrations ran
[[SignalApp sharedApp].callService createCallUIAdapter];
// Note that this does much more than set a flag;
// it will also run all deferred blocks.

@ -26,8 +26,6 @@ class NonCallKitCallUIAdaptee: NSObject, CallUIAdaptee {
self.notificationsAdapter = notificationsAdapter
super.init()
SwiftSingletons.register(self)
}
func startOutgoingCall(handle: String) -> SignalCall {

@ -76,6 +76,8 @@
OWSAssert(self.accountManager);
OWSAssert(Environment.current.contactsManager);
OWSAssert(Environment.current.messageSender);
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didChangeCallLoggingPreference:) name:OWSPreferencesCallLoggingDidChangeNotification object:nil];
_callService = [[CallService alloc] initWithAccountManager:self.accountManager
contactsManager:Environment.current.contactsManager
messageSender:Environment.current.messageSender
@ -234,6 +236,11 @@
});
}
- (void)didChangeCallLoggingPreference:(NSNotification *)notitication
{
[self.callService createCallUIAdapter];
}
#pragma mark - Methods
+ (void)resetAppData

@ -16,6 +16,7 @@ typedef NS_ENUM(NSUInteger, NotificationType) {
// Used when migrating logging to NSUserDefaults.
extern NSString *const OWSPreferencesSignalDatabaseCollection;
extern NSString *const OWSPreferencesKeyEnableDebugLog;
extern NSString *const OWSPreferencesCallLoggingDidChangeNotification;
@class YapDatabaseReadWriteTransaction;

@ -8,10 +8,12 @@
#import <SignalServiceKit/TSStorageHeaders.h>
#import <SignalServiceKit/YapDatabaseConnection+OWS.h>
#import <SignalServiceKit/YapDatabaseTransaction+OWS.h>
#import <SignalServiceKit/NSNotificationCenter+OWS.h>
NS_ASSUME_NONNULL_BEGIN
NSString *const OWSPreferencesSignalDatabaseCollection = @"SignalPreferences";
NSString *const OWSPreferencesCallLoggingDidChangeNotification = @"OWSPreferencesCallLoggingDidChangeNotification";
NSString *const OWSPreferencesKeyScreenSecurity = @"Screen Security Key";
NSString *const OWSPreferencesKeyEnableDebugLog = @"Debugging Log Enabled Key";
@ -259,6 +261,11 @@ NSString *const OWSPreferencesKeySystemCallLogEnabled = @"OWSPreferencesKeySyste
[self setValueForKey:OWSPreferencesKeySystemCallLogEnabled
toValue:@(shouldLogCallsInRecents)
transaction:transaction];
// We need to reload the callService.callUIAdapter here, but SignalMessaging doesn't know about CallService, so we use
// notifications to decouple the code. This is admittedly awkward, but it only happens once, and the alternative would
// be importing all the call related classes into SignalMessaging.
[[NSNotificationCenter defaultCenter] postNotificationNameAsync:OWSPreferencesCallLoggingDidChangeNotification object:nil];
}
- (BOOL)isCallKitEnabled

Loading…
Cancel
Save