From 21304c18a6e701e23af3ab0ed822584d89c6f1f6 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Fri, 4 Aug 2017 12:52:34 -0400 Subject: [PATCH] Once we've shared our profile key with a user (perhaps due to being a member of a whitelisted group), make sure they're whitelisted. // FREEBIE --- SignalServiceKit/src/Protocols/ProtoBuf+OWS.m | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SignalServiceKit/src/Protocols/ProtoBuf+OWS.m b/SignalServiceKit/src/Protocols/ProtoBuf+OWS.m index ac7ca54f7..98d91db72 100644 --- a/SignalServiceKit/src/Protocols/ProtoBuf+OWS.m +++ b/SignalServiceKit/src/Protocols/ProtoBuf+OWS.m @@ -50,6 +50,13 @@ NS_ASSUME_NONNULL_BEGIN if ([self shouldMessageHaveLocalProfileKey:thread recipientId:recipientId]) { [self setProfileKey:self.localProfileKey]; + + if (recipientId.length > 0) { + // Once we've shared our profile key with a user (perhaps due to being + // a member of a whitelisted group), make sure they're whitelisted. + id profileManager = [TextSecureKitEnv sharedEnv].profileManager; + [profileManager addUserToProfileWhitelist:recipientId]; + } } } @@ -66,6 +73,11 @@ NS_ASSUME_NONNULL_BEGIN if ([self shouldMessageHaveLocalProfileKey:thread recipientId:recipientId]) { [self setProfileKey:self.localProfileKey]; + + // Once we've shared our profile key with a user (perhaps due to being + // a member of a whitelisted group), make sure they're whitelisted. + id profileManager = [TextSecureKitEnv sharedEnv].profileManager; + [profileManager addUserToProfileWhitelist:recipientId]; } }