compose w/o contact access -> "..by phone number"

The search field and invite buttons are not very useful without contacts
access.

// FREEBIE
pull/1/head
Michael Kirk 8 years ago
parent 0b6962cdd0
commit 03727a27f6

@ -115,9 +115,18 @@ NS_ASSUME_NONNULL_BEGIN
[self updateTableContents]; [self updateTableContents];
} }
- (void)showContactsPermissionReminder:(BOOL)flag - (void)showContactsPermissionReminder:(BOOL)isVisible
{ {
_hideContactsPermissionReminderViewConstraint.active = !flag; _hideContactsPermissionReminderViewConstraint.active = !isVisible;
}
- (void)showSearchBar:(BOOL)isVisible
{
if (isVisible) {
self.tableViewController.tableView.tableHeaderView = self.searchBar;
} else {
self.tableViewController.tableView.tableHeaderView = nil;
}
} }
- (UIView *)createNoSignalContactsView - (UIView *)createNoSignalContactsView
@ -259,6 +268,7 @@ NS_ASSUME_NONNULL_BEGIN
[weakSelf.navigationController pushViewController:viewController animated:YES]; [weakSelf.navigationController pushViewController:viewController animated:YES];
}]]; }]];
if (self.contactsViewHelper.contactsManager.isSystemContactsAuthorized) {
// Invite Contacts // Invite Contacts
[section addItem:[OWSTableItem itemWithCustomCellBlock:^{ [section addItem:[OWSTableItem itemWithCustomCellBlock:^{
UITableViewCell *cell = [UITableViewCell new]; UITableViewCell *cell = [UITableViewCell new];
@ -273,6 +283,7 @@ NS_ASSUME_NONNULL_BEGIN
actionBlock:^{ actionBlock:^{
[weakSelf presentInviteFlow]; [weakSelf presentInviteFlow];
}]]; }]];
}
// If the search string looks like a phone number, show either "new conversation..." cells and/or // If the search string looks like a phone number, show either "new conversation..." cells and/or
// "invite via SMS..." cells. // "invite via SMS..." cells.
@ -445,10 +456,13 @@ NS_ASSUME_NONNULL_BEGIN
BOOL hasNoContacts = self.contactsViewHelper.signalAccounts.count < 1; BOOL hasNoContacts = self.contactsViewHelper.signalAccounts.count < 1;
self.isNoContactsModeActive = (hasNoContacts && ![[Environment preferences] hasDeclinedNoContactsView]); self.isNoContactsModeActive = (hasNoContacts && ![[Environment preferences] hasDeclinedNoContactsView]);
[self showContactsPermissionReminder:NO]; [self showContactsPermissionReminder:NO];
[self showSearchBar:YES];
} else { } else {
// don't show "no signal contacts", show "no contact access" // don't show "no signal contacts", show "no contact access"
self.isNoContactsModeActive = NO; self.isNoContactsModeActive = NO;
[self showContactsPermissionReminder:YES]; [self showContactsPermissionReminder:YES];
[self showSearchBar:NO];
} }
} }

Loading…
Cancel
Save