Attach a profile key if we're friends with a contact.
This commit is contained in:
parent
9cde326254
commit
eafc2afe4a
|
@ -916,6 +916,8 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
|
|||
TSGroupThread *groupThread = (TSGroupThread *)thread;
|
||||
NSData *groupId = groupThread.groupModel.groupId;
|
||||
return [self isGroupIdInProfileWhitelist:groupId];
|
||||
} else if (thread.friendRequestStatus == LKThreadFriendRequestStatusFriends) {
|
||||
return true;
|
||||
} else {
|
||||
NSString *recipientId = thread.contactIdentifier;
|
||||
return [self isUserInProfileWhitelist:recipientId];
|
||||
|
@ -1067,7 +1069,7 @@ typedef void (^ProfileManagerFailureBlock)(NSError *error);
|
|||
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
if (userProfile.avatarUrlPath.length < 1) {
|
||||
OWSFailDebug(@"Malformed avatar URL: %@", userProfile.avatarUrlPath);
|
||||
OWSLogDebug(@"Skipping downloading avatar for %@ because url is not set", userProfile.recipientId);
|
||||
return;
|
||||
}
|
||||
NSString *_Nullable avatarUrlPathAtStart = userProfile.avatarUrlPath;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#import "OWSContactsOutputStream.h"
|
||||
#import "OWSIdentityManager.h"
|
||||
#import "ProfileManagerProtocol.h"
|
||||
#import "ProtoUtils.h"
|
||||
#import "SSKEnvironment.h"
|
||||
#import "SignalAccount.h"
|
||||
#import "TSAccountManager.h"
|
||||
|
@ -111,6 +112,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
[profileBuilder setProfilePicture:profilePictureURL ?: @""];
|
||||
SSKProtoDataMessageBuilder *messageBuilder = [SSKProtoDataMessage builder];
|
||||
[messageBuilder setProfile:[profileBuilder buildAndReturnError:nil]];
|
||||
[ProtoUtils addLocalProfileKeyToDataMessageBuilder:messageBuilder];
|
||||
|
||||
SSKProtoSyncMessageSentBuilder *transcriptBuilder = [SSKProtoSyncMessageSent builder];
|
||||
[transcriptBuilder setMessage:[messageBuilder buildAndReturnError:nil]];
|
||||
[syncMessageBuilder setSent:[transcriptBuilder buildAndReturnError:nil]];
|
||||
|
|
Loading…
Reference in New Issue