|
|
@ -715,13 +715,14 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
OWSSignalServiceProtosDataMessage *dataMessage = syncMessage.sent.message;
|
|
|
|
OWSSignalServiceProtosDataMessage *dataMessage = syncMessage.sent.message;
|
|
|
|
OWSAssert(dataMessage);
|
|
|
|
OWSAssert(dataMessage);
|
|
|
|
NSString *destination = syncMessage.sent.destination;
|
|
|
|
NSString *destination = syncMessage.sent.destination;
|
|
|
|
if (dataMessage && destination.length > 0 && [dataMessage hasProfileKey]) {
|
|
|
|
if (dataMessage && destination.length > 0 && dataMessage.hasProfileKey) {
|
|
|
|
// If we observe a linked device sending our profile key to another
|
|
|
|
// If we observe a linked device sending our profile key to another
|
|
|
|
// user, we can infer that that user belongs in our profile whitelist.
|
|
|
|
// user, we can infer that that user belongs in our profile whitelist.
|
|
|
|
[self.profileManager addUserToProfileWhitelist:destination];
|
|
|
|
if (dataMessage.hasGroup) {
|
|
|
|
|
|
|
|
[self.profileManager addGroupIdToProfileWhitelist:dataMessage.group.id];
|
|
|
|
// TODO: Can we also infer when groups are added to the whitelist
|
|
|
|
} else {
|
|
|
|
// from sent messages to groups?
|
|
|
|
[self.profileManager addUserToProfileWhitelist:destination];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ([self isDataMessageGroupAvatarUpdate:syncMessage.sent.message]) {
|
|
|
|
if ([self isDataMessageGroupAvatarUpdate:syncMessage.sent.message]) {
|
|
|
|