Apply refinements to UD logic.

This commit is contained in:
Matthew Chen 2018-10-30 14:30:10 -04:00
parent c28d131f97
commit 44f6774396

View file

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