From 459101c20e9a8a2a1df11729e9c37e2bee85f79a Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 3 May 2018 16:25:50 -0400 Subject: [PATCH] Add feature flag for contact sharing. --- .../ConversationViewController.m | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 0bc937072..9e9a250ad 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -3615,17 +3615,20 @@ typedef enum : NSUInteger { [gifAction setValue:gifImage forKey:@"image"]; [actionSheetController addAction:gifAction]; - UIAlertAction *chooseContactAction = [UIAlertAction - actionWithTitle:NSLocalizedString(@"ATTACHMENT_MENU_CONTACT_BUTTON", @"attachment menu option to send contact") - style:UIAlertActionStyleDefault - handler:^(UIAlertAction *_Nonnull action) { - [self chooseContactForSending]; - }]; - // TODO - proper image - UIImage *chooseContactImage = [UIImage imageNamed:@"actionsheet_camera_black"]; - OWSAssert(takeMediaImage); - [chooseContactAction setValue:chooseContactImage forKey:@"image"]; - [actionSheetController addAction:chooseContactAction]; + if (kIsSendingContactSharesEnabled) { + UIAlertAction *chooseContactAction = + [UIAlertAction actionWithTitle:NSLocalizedString(@"ATTACHMENT_MENU_CONTACT_BUTTON", + @"attachment menu option to send contact") + style:UIAlertActionStyleDefault + handler:^(UIAlertAction *_Nonnull action) { + [self chooseContactForSending]; + }]; + // TODO - proper image + UIImage *chooseContactImage = [UIImage imageNamed:@"actionsheet_camera_black"]; + OWSAssert(takeMediaImage); + [chooseContactAction setValue:chooseContactImage forKey:@"image"]; + [actionSheetController addAction:chooseContactAction]; + } [self dismissKeyBoard]; [self presentViewController:actionSheetController animated:true completion:nil];