|
|
@ -338,26 +338,8 @@ typedef enum : NSUInteger {
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
|
|
|
|
|
|
|
|
[self ensureDynamicInteractions];
|
|
|
|
[self ensureDynamicInteractions];
|
|
|
|
|
|
|
|
|
|
|
|
// [self tryToShowContactShareUI];
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//- (void)tryToShowContactShareUI
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// OWSAssertIsOnMainThread();
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Contact *_Nullable firstContact = self.contactsManager.allContacts.firstObject;
|
|
|
|
|
|
|
|
// DDLogInfo(@"%@ firstContact: %@ %d", self.logTag, firstContact, firstContact.cnContact != nil);
|
|
|
|
|
|
|
|
// [DDLog flushLog];
|
|
|
|
|
|
|
|
// if (!firstContact.cnContact) {
|
|
|
|
|
|
|
|
// return;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// static dispatch_once_t onceToken;
|
|
|
|
|
|
|
|
// dispatch_once(&onceToken, ^{
|
|
|
|
|
|
|
|
// [self contactsPicker:nil didSelectContact:firstContact];
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)otherUsersProfileDidChange:(NSNotification *)notification
|
|
|
|
- (void)otherUsersProfileDidChange:(NSNotification *)notification
|
|
|
|
{
|
|
|
|
{
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
|
OWSAssertIsOnMainThread();
|
|
|
@ -508,11 +490,6 @@ typedef enum : NSUInteger {
|
|
|
|
|
|
|
|
|
|
|
|
[self addNotificationListeners];
|
|
|
|
[self addNotificationListeners];
|
|
|
|
[self loadDraftInCompose];
|
|
|
|
[self loadDraftInCompose];
|
|
|
|
|
|
|
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
|
|
|
[self showPhonyContactShareApproval];
|
|
|
|
|
|
|
|
// [self tryToShowContactShareUI];
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (void)loadView
|
|
|
|
- (void)loadView
|
|
|
@ -4948,79 +4925,6 @@ interactionControllerForAnimationController:(id<UIViewControllerAnimatedTransiti
|
|
|
|
|
|
|
|
|
|
|
|
#pragma mark - ContactsPickerDelegate
|
|
|
|
#pragma mark - ContactsPickerDelegate
|
|
|
|
|
|
|
|
|
|
|
|
- (void)showPhonyContactShareApproval
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ApproveContactShareViewController *approveContactShare =
|
|
|
|
|
|
|
|
[[ApproveContactShareViewController alloc] initWithContactShare:self.makePhonyContact
|
|
|
|
|
|
|
|
contactsManager:self.contactsManager
|
|
|
|
|
|
|
|
delegate:self];
|
|
|
|
|
|
|
|
// contactsPicker.title
|
|
|
|
|
|
|
|
// = NSLocalizedString(@"CONTACT_PICKER_TITLE", @"navbar title for contact picker when sharing a contact");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UINavigationController *navigationController =
|
|
|
|
|
|
|
|
[[UINavigationController alloc] initWithRootViewController:approveContactShare];
|
|
|
|
|
|
|
|
[self dismissKeyBoard];
|
|
|
|
|
|
|
|
[self presentViewController:navigationController animated:YES completion:nil];
|
|
|
|
|
|
|
|
// [self contactsPicker:nil didSelectContact:self.makePhonyContact];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (OWSContact *)makePhonyContact
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
OWSContact *contact = [OWSContact new];
|
|
|
|
|
|
|
|
contact.givenName = @"Alice";
|
|
|
|
|
|
|
|
contact.familyName = @"Carol";
|
|
|
|
|
|
|
|
contact.middleName = @"Bob";
|
|
|
|
|
|
|
|
contact.namePrefix = @"Ms.";
|
|
|
|
|
|
|
|
contact.nameSuffix = @"Esq.";
|
|
|
|
|
|
|
|
contact.organizationName = @"Falafel Hut";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OWSContactPhoneNumber *phoneNumber1 = [OWSContactPhoneNumber new];
|
|
|
|
|
|
|
|
phoneNumber1.phoneType = OWSContactPhoneType_Home;
|
|
|
|
|
|
|
|
phoneNumber1.phoneNumber = @"+13213214321";
|
|
|
|
|
|
|
|
OWSContactPhoneNumber *phoneNumber2 = [OWSContactPhoneNumber new];
|
|
|
|
|
|
|
|
phoneNumber2.phoneType = OWSContactPhoneType_Custom;
|
|
|
|
|
|
|
|
phoneNumber2.label = @"Carphone";
|
|
|
|
|
|
|
|
phoneNumber2.phoneNumber = @"+13332221111";
|
|
|
|
|
|
|
|
contact.phoneNumbers = @[
|
|
|
|
|
|
|
|
phoneNumber1,
|
|
|
|
|
|
|
|
phoneNumber2,
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NSMutableArray<OWSContactEmail *> *emails = [NSMutableArray new];
|
|
|
|
|
|
|
|
for (NSUInteger i = 0; i < 16; i++) {
|
|
|
|
|
|
|
|
OWSContactEmail *email = [OWSContactEmail new];
|
|
|
|
|
|
|
|
email.emailType = OWSContactEmailType_Home;
|
|
|
|
|
|
|
|
email.email = [NSString stringWithFormat:@"a%zd@b.com", i];
|
|
|
|
|
|
|
|
[emails addObject:email];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
contact.emails = emails;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OWSContactAddress *address1 = [OWSContactAddress new];
|
|
|
|
|
|
|
|
address1.addressType = OWSContactAddressType_Home;
|
|
|
|
|
|
|
|
address1.street = @"123 home st.";
|
|
|
|
|
|
|
|
address1.neighborhood = @"round the bend.";
|
|
|
|
|
|
|
|
address1.city = @"homeville";
|
|
|
|
|
|
|
|
address1.region = @"HO";
|
|
|
|
|
|
|
|
address1.postcode = @"12345";
|
|
|
|
|
|
|
|
address1.country = @"USA";
|
|
|
|
|
|
|
|
OWSContactAddress *address2 = [OWSContactAddress new];
|
|
|
|
|
|
|
|
address2.addressType = OWSContactAddressType_Custom;
|
|
|
|
|
|
|
|
address2.label = @"Otra casa";
|
|
|
|
|
|
|
|
address2.pobox = @"caja 123";
|
|
|
|
|
|
|
|
address2.street = @"123 casa calle";
|
|
|
|
|
|
|
|
address2.city = @"barrio norte";
|
|
|
|
|
|
|
|
address2.region = @"AB";
|
|
|
|
|
|
|
|
address2.postcode = @"53421";
|
|
|
|
|
|
|
|
address2.country = @"MX";
|
|
|
|
|
|
|
|
contact.addresses = @[
|
|
|
|
|
|
|
|
address1,
|
|
|
|
|
|
|
|
address2,
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Avatar
|
|
|
|
|
|
|
|
return contact;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)contactsPickerDidCancel:(ContactsPicker *)contactsPicker
|
|
|
|
- (void)contactsPickerDidCancel:(ContactsPicker *)contactsPicker
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DDLogDebug(@"%@ in %s", self.logTag, __PRETTY_FUNCTION__);
|
|
|
|
DDLogDebug(@"%@ in %s", self.logTag, __PRETTY_FUNCTION__);
|
|
|
@ -5044,16 +4948,11 @@ interactionControllerForAnimationController:(id<UIViewControllerAnimatedTransiti
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO actually build contact message.
|
|
|
|
|
|
|
|
// self.inputToolbar.messageText = contact.fullName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: We should probably show this in the same navigation view controller.
|
|
|
|
// TODO: We should probably show this in the same navigation view controller.
|
|
|
|
ApproveContactShareViewController *approveContactShare =
|
|
|
|
ApproveContactShareViewController *approveContactShare =
|
|
|
|
[[ApproveContactShareViewController alloc] initWithContactShare:contactShare
|
|
|
|
[[ApproveContactShareViewController alloc] initWithContactShare:contactShare
|
|
|
|
contactsManager:self.contactsManager
|
|
|
|
contactsManager:self.contactsManager
|
|
|
|
delegate:self];
|
|
|
|
delegate:self];
|
|
|
|
// contactsPicker.title
|
|
|
|
|
|
|
|
// = NSLocalizedString(@"CONTACT_PICKER_TITLE", @"navbar title for contact picker when sharing a contact");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UINavigationController *navigationController =
|
|
|
|
UINavigationController *navigationController =
|
|
|
|
[[UINavigationController alloc] initWithRootViewController:approveContactShare];
|
|
|
|
[[UINavigationController alloc] initWithRootViewController:approveContactShare];
|
|
|
|