зеркало из https://github.com/nextcloud/talk-ios.git
Check "phonebook-search" capability.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Родитель
336fdbe5d4
Коммит
afc68b25ad
|
@ -53,6 +53,7 @@ extern NSString * const kCapabilityChatReadMarker;
|
|||
extern NSString * const kCapabilityStartCallFlag;
|
||||
extern NSString * const kCapabilityCirclesSupport;
|
||||
extern NSString * const kCapabilityChatReferenceId;
|
||||
extern NSString * const kCapabilityPhonebookSearch;
|
||||
|
||||
extern NSInteger const kDefaultChatMaxLength;
|
||||
extern NSString * const kMinimumRequiredTalkCapability;
|
||||
|
|
|
@ -77,6 +77,7 @@ NSString * const kCapabilityChatReadMarker = @"chat-read-marker";
|
|||
NSString * const kCapabilityStartCallFlag = @"start-call-flag";
|
||||
NSString * const kCapabilityCirclesSupport = @"circles-support";
|
||||
NSString * const kCapabilityChatReferenceId = @"chat-reference-id";
|
||||
NSString * const kCapabilityPhonebookSearch = @"phonebook-search";
|
||||
|
||||
NSInteger const kDefaultChatMaxLength = 1000;
|
||||
NSString * const kMinimumRequiredTalkCapability = kCapabilitySystemMessages; // Talk 4.0 is the minimum required version
|
||||
|
|
|
@ -160,7 +160,7 @@ NSString * const NCSelectedContactForChatNotification = @"NCSelectedContactForCh
|
|||
self.navigationController.navigationBar.topItem.leftBarButtonItem = cancelButton;
|
||||
self.navigationController.navigationBar.topItem.leftBarButtonItem.accessibilityHint = NSLocalizedString(@"Cancel conversation creation", nil);
|
||||
|
||||
if ([[NCSettingsController sharedInstance] isContactSyncEnabled]) {
|
||||
if ([[NCSettingsController sharedInstance] isContactSyncEnabled] && [[NCSettingsController sharedInstance] serverHasTalkCapability:kCapabilityPhonebookSearch]) {
|
||||
UIBarButtonItem *moreOptionButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"more-action"]
|
||||
style:UIBarButtonItemStylePlain
|
||||
target:self
|
||||
|
@ -189,8 +189,11 @@ NSString * const NCSelectedContactForChatNotification = @"NCSelectedContactForCh
|
|||
self.navigationItem.hidesSearchBarWhenScrolling = NO;
|
||||
}
|
||||
|
||||
[[NCContactsManager sharedInstance] searchInServerForAddressBookContacts:NO];
|
||||
[self getAddressBookContacts];
|
||||
if ([[NCSettingsController sharedInstance] isContactSyncEnabled] && [[NCSettingsController sharedInstance] serverHasTalkCapability:kCapabilityPhonebookSearch]) {
|
||||
[[NCContactsManager sharedInstance] searchInServerForAddressBookContacts:NO];
|
||||
[self getAddressBookContacts];
|
||||
}
|
||||
|
||||
[self getServerContacts];
|
||||
}
|
||||
|
||||
|
|
|
@ -180,7 +180,9 @@ typedef enum AboutSection {
|
|||
[options addObject:[NSNumber numberWithInt:kConfigurationSectionOptionBrowser]];
|
||||
}
|
||||
// Contacts sync
|
||||
[options addObject:[NSNumber numberWithInt:kConfigurationSectionOptionContactsSync]];
|
||||
if ([[NCSettingsController sharedInstance] serverHasTalkCapability:kCapabilityPhonebookSearch]) {
|
||||
[options addObject:[NSNumber numberWithInt:kConfigurationSectionOptionContactsSync]];
|
||||
}
|
||||
|
||||
return [NSArray arrayWithArray:options];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче