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

Loading…
Cancel
Save