Fix check for outgoing sync messages to 1:1 chats
This commit is contained in:
parent
973d5a7394
commit
e90d3a400d
@ -84,11 +84,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
OWSFailDebug(@"Invalid groupId.");
|
||||
return nil;
|
||||
}
|
||||
} else if (sentProto.destinationServiceID) {
|
||||
} else if (sentProto.destinationServiceID || sentProto.destinationE164) {
|
||||
SignalServiceAddress *destinationAddress =
|
||||
[[SignalServiceAddress alloc] initWithServiceIdString:sentProto.destinationServiceID];
|
||||
[[SignalServiceAddress alloc] initWithServiceIdString:sentProto.destinationServiceID
|
||||
phoneNumber:sentProto.destinationE164];
|
||||
if (!destinationAddress.isValid) {
|
||||
OWSFailDebug(@"Invalid serviceID.");
|
||||
OWSFailDebug(@"Invalid destinationAddress.");
|
||||
return nil;
|
||||
}
|
||||
_recipientAddress = destinationAddress;
|
||||
|
||||
@ -870,19 +870,22 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
return;
|
||||
}
|
||||
|
||||
// If we observe a linked device sending our profile key to another user,
|
||||
// we can infer that that user belongs in our profile whitelist.
|
||||
SignalServiceAddress *destinationAddress =
|
||||
[[SignalServiceAddress alloc] initWithServiceIdString:syncMessage.sent.destinationServiceID];
|
||||
if (dataMessage && destinationAddress.isValid && dataMessage.hasProfileKey) {
|
||||
if (dataMessage && dataMessage.hasProfileKey) {
|
||||
if (groupId != nil) {
|
||||
[self.profileManager addGroupIdToProfileWhitelist:groupId
|
||||
userProfileWriter:UserProfileWriter_LocalUser
|
||||
transaction:transaction];
|
||||
} else {
|
||||
[self.profileManager addUserToProfileWhitelist:destinationAddress
|
||||
userProfileWriter:UserProfileWriter_LocalUser
|
||||
transaction:transaction];
|
||||
// If we observe a linked device sending our profile key to another user,
|
||||
// we can infer that that user belongs in our profile whitelist.
|
||||
SignalServiceAddress *destinationAddress =
|
||||
[[SignalServiceAddress alloc] initWithServiceIdString:syncMessage.sent.destinationServiceID
|
||||
phoneNumber:syncMessage.sent.destinationE164];
|
||||
if (destinationAddress.isValid) {
|
||||
[self.profileManager addUserToProfileWhitelist:destinationAddress
|
||||
userProfileWriter:UserProfileWriter_LocalUser
|
||||
transaction:transaction];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user