mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-02 14:16:59 +02:00
Local contacts: Consider the local contacts when the access is authorized even if the server sync option is disabled.
This commit is contained in:
@@ -801,13 +801,15 @@
|
||||
self.isAddParticipantSearchBarEditing = YES;
|
||||
searchBar.showsCancelButton = NO;
|
||||
|
||||
// Handle here local contacts
|
||||
#ifdef MX_USE_CONTACTS_SERVER_SYNC
|
||||
if (![MXKAppSettings standardAppSettings].syncLocalContacts)
|
||||
{
|
||||
// If not requested yet, ask user permission to sync their local contacts
|
||||
if (![MXKAppSettings standardAppSettings].syncLocalContacts && ![MXKAppSettings standardAppSettings].syncLocalContactsPermissionRequested)
|
||||
{
|
||||
[MXKAppSettings standardAppSettings].syncLocalContactsPermissionRequested = YES;
|
||||
|
||||
|
||||
[MXKContactManager requestUserConfirmationForLocalContactsSyncInViewController:self completionHandler:^(BOOL granted) {
|
||||
if (granted)
|
||||
{
|
||||
@@ -817,6 +819,18 @@
|
||||
}];
|
||||
}
|
||||
}
|
||||
#else
|
||||
// If not requested yet, ask user permission to access their local contacts
|
||||
if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined)
|
||||
{
|
||||
// Try to load the local contacts list
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
[[MXKContactManager sharedManager] loadLocalContacts];
|
||||
|
||||
});
|
||||
}
|
||||
#endif
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user