|
|
|
@ -531,27 +531,22 @@ typedef enum : NSUInteger {
|
|
|
|
|
|
|
|
|
|
- (void)handleUserFriendRequestStatusChangedNotification:(NSNotification *)notification
|
|
|
|
|
{
|
|
|
|
|
// Check thread
|
|
|
|
|
NSString *hexEncodedPublicKey = (NSString *)notification.object;
|
|
|
|
|
// Friend request status doesn't apply to group threads
|
|
|
|
|
if (self.thread.isGroupThread) { return; }
|
|
|
|
|
|
|
|
|
|
__block BOOL shouldReload = [self.thread.contactIdentifier isEqualToString:hexEncodedPublicKey];
|
|
|
|
|
|
|
|
|
|
// Check to see if this is a linked device
|
|
|
|
|
if (![self.thread.contactIdentifier isEqualToString:hexEncodedPublicKey]) {
|
|
|
|
|
NSString *hexEncodedPublicKey = (NSString *)notification.object;
|
|
|
|
|
// Check if we should update the UI
|
|
|
|
|
__block BOOL needsUpdate;
|
|
|
|
|
[OWSPrimaryStorage.sharedManager.dbReadConnection readWithBlock:^(YapDatabaseReadTransaction *transaction) {
|
|
|
|
|
NSSet<NSString *> *linkedDevices = [LKDatabaseUtilities getLinkedDeviceHexEncodedPublicKeysFor:self.thread.contactIdentifier in:transaction];
|
|
|
|
|
shouldReload = [linkedDevices containsObject:hexEncodedPublicKey];
|
|
|
|
|
needsUpdate = [linkedDevices containsObject:hexEncodedPublicKey];
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
if (shouldReload) {
|
|
|
|
|
// Ensure thread instance is up to date
|
|
|
|
|
if (!needsUpdate) { return; }
|
|
|
|
|
// Ensure the thread instance is up to date
|
|
|
|
|
[self.thread reload];
|
|
|
|
|
// Update UI
|
|
|
|
|
// Update the UI
|
|
|
|
|
[self.viewItems.lastObject clearCachedLayoutState];
|
|
|
|
|
[self updateInputToolbar];
|
|
|
|
|
[self resetContentAndLayout];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)handleThreadSessionRestoreDevicesChangedNotifiaction:(NSNotification *)notification
|
|
|
|
|