Apply refinements to UD logic.

pull/1/head
Matthew Chen 7 years ago
parent c28d131f97
commit 44f6774396

@ -1453,13 +1453,12 @@ NS_ASSUME_NONNULL_BEGIN
return; return;
} }
BOOL isRecipientDevice = YES;
SignalRecipient *_Nullable recipient = SignalRecipient *_Nullable recipient =
[SignalRecipient registeredRecipientForRecipientId:localNumber transaction:transaction]; [SignalRecipient registeredRecipientForRecipientId:localNumber transaction:transaction];
if (!recipient) { if (!recipient) {
OWSFailDebug(@"No local SignalRecipient."); OWSFailDebug(@"No local SignalRecipient.");
} else { } else {
isRecipientDevice = [recipient.devices containsObject:@(envelope.sourceDevice)]; BOOL isRecipientDevice = [recipient.devices containsObject:@(envelope.sourceDevice)];
if (!isRecipientDevice) { if (!isRecipientDevice) {
OWSLogInfo(@"Message received from unknown linked device; adding to local SignalRecipient: %lu.", OWSLogInfo(@"Message received from unknown linked device; adding to local SignalRecipient: %lu.",
(unsigned long) envelope.sourceDevice); (unsigned long) envelope.sourceDevice);
@ -1480,9 +1479,6 @@ NS_ASSUME_NONNULL_BEGIN
(unsigned long) envelope.sourceDevice); (unsigned long) envelope.sourceDevice);
[OWSDevicesService refreshDevices]; [OWSDevicesService refreshDevices];
}
if (!isRecipientDevice || !isInDeviceList) {
[self.profileManager fetchLocalUsersProfile]; [self.profileManager fetchLocalUsersProfile];
} }
} }

Loading…
Cancel
Save