Fix edge cases around UD v. linked devices.

pull/1/head
Matthew Chen 7 years ago
parent b83299888f
commit 00d79900e4

@ -9,6 +9,7 @@
#import "NSTimer+OWS.h"
#import "NotificationsProtocol.h"
#import "OWSBackgroundTask.h"
#import "OWSDevicesService.h"
#import "OWSError.h"
#import "OWSMessageManager.h"
#import "OWSMessageReceiver.h"
@ -297,6 +298,10 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O
selector:@selector(isCensorshipCircumventionActiveDidChange:)
name:kNSNotificationName_IsCensorshipCircumventionActiveDidChange
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(deviceListUpdateModifiedDeviceList:)
name:NSNotificationName_DeviceListUpdateModifiedDeviceList
object:nil];
}
#pragma mark - Manage Socket
@ -1134,6 +1139,15 @@ NSString *const kNSNotification_OWSWebSocketStateDidChange = @"kNSNotification_O
[self applyDesiredSocketState];
}
- (void)deviceListUpdateModifiedDeviceList:(NSNotification *)notification
{
OWSAssertIsOnMainThread();
if (self.webSocketType == OWSWebSocketTypeDefault) {
[self cycleSocket];
}
}
@end
NS_ASSUME_NONNULL_END

Loading…
Cancel
Save