diff --git a/Riot/Modules/Contacts/ContactsTableViewController.h b/Riot/Modules/Contacts/ContactsTableViewController.h index a196bd788..eeb3185a8 100644 --- a/Riot/Modules/Contacts/ContactsTableViewController.h +++ b/Riot/Modules/Contacts/ContactsTableViewController.h @@ -66,6 +66,13 @@ */ @property (weak, nonatomic) IBOutlet UITableView *contactsTableView; +/** + When true, the footer that allows the user to grant access to their contacts will + never be shown. When false, the footer will shown when the required access is + not available. + */ +@property (nonatomic) BOOL hideRequestContactAccessFooter; + /** If YES, the table view will scroll at the top on the next data source refresh. It comes back to NO after each refresh. diff --git a/Riot/Modules/Contacts/ContactsTableViewController.m b/Riot/Modules/Contacts/ContactsTableViewController.m index ee60995da..03e0e7107 100644 --- a/Riot/Modules/Contacts/ContactsTableViewController.m +++ b/Riot/Modules/Contacts/ContactsTableViewController.m @@ -68,6 +68,9 @@ { [super finalizeInit]; + // Allow the contact access footer to be shown when necessary. + self.hideRequestContactAccessFooter = NO; + // Setup `MXKViewControllerHandling` properties self.enableBarTintColorStatusChange = NO; self.rageShakeManager = [RageShakeManager sharedManager]; @@ -211,7 +214,7 @@ - (void)updateFooterView { - if (!BuildSettings.allowLocalContactsAccess) + if (!BuildSettings.allowLocalContactsAccess || self.hideRequestContactAccessFooter) { self.contactsTableView.tableFooterView = [[UIView alloc] init]; return; diff --git a/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m b/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m index bec3f836f..12a63f041 100644 --- a/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m +++ b/Riot/Modules/GlobalSearch/UnifiedSearchViewController.m @@ -91,6 +91,7 @@ [titles addObject: NSLocalizedStringFromTable(@"search_people", @"Vector", nil)]; peopleSearchViewController = [ContactsTableViewController contactsTableViewController]; peopleSearchViewController.contactsTableViewControllerDelegate = self; + peopleSearchViewController.hideRequestContactAccessFooter = YES; [viewControllers addObject:peopleSearchViewController]; // add Files tab