Merge branch 'charlesmchen/contactSharingFeatureFlag'

This commit is contained in:
Matthew Chen 2018-05-04 09:35:56 -04:00
commit d4bec2d068
3 changed files with 18 additions and 11 deletions

View file

@ -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];

View file

@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
@class TSAttachment;
@class YapDatabaseReadWriteTransaction;
extern BOOL kIsSendingContactSharesEnabled;
typedef NS_ENUM(NSUInteger, OWSContactPhoneType) {
OWSContactPhoneType_Home = 1,
OWSContactPhoneType_Mobile,

View file

@ -14,6 +14,8 @@
NS_ASSUME_NONNULL_BEGIN
BOOL kIsSendingContactSharesEnabled = YES;
@interface OWSContactPhoneNumber ()
@property (nonatomic) OWSContactPhoneType phoneType;