Disable profile-key sending with feature flag

// FREEBIE
This commit is contained in:
Michael Kirk 2017-08-28 17:37:10 -04:00
parent ec0cf36abb
commit 55d0db8c46
1 changed files with 10 additions and 0 deletions

View File

@ -1367,9 +1367,19 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
messageSender:(OWSMessageSender *)messageSender
success:(void (^)())successHandler
{
AssertIsOnMainThread();
OWSProfileKeyMessage *message =
[[OWSProfileKeyMessage alloc] initWithTimestamp:[NSDate ows_millisecondTimeStamp] inThread:thread];
BOOL isFeatureEnabled = NO;
if (!isFeatureEnabled) {
DDLogWarn(@"%@ skipping sending profile-key message because the feature is not yet fully available.", self.tag);
[OWSProfileManager.sharedManager addThreadToProfileWhitelist:thread];
successHandler();
return;
}
[messageSender sendMessage:message
success:^{
DDLogInfo(@"%@ Successfully sent profile key message to thread: %@", self.tag, thread);