mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 23:32:41 +00:00
Integrate alloLocalContactsAccess at more points
This commit is contained in:
parent
c6d04fc075
commit
eecd7ebca4
3 changed files with 24 additions and 10 deletions
|
@ -3000,6 +3000,11 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
|||
|
||||
- (void)refreshLocalContacts
|
||||
{
|
||||
if (!BuildSettings.allowLocalContactsAccess)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not scan local contacts in background if the user has not decided yet about using
|
||||
// an identity server
|
||||
BOOL doRefreshLocalContacts = NO;
|
||||
|
|
|
@ -151,15 +151,18 @@
|
|||
// Screen tracking
|
||||
[[Analytics sharedInstance] trackScreen:_screenName];
|
||||
|
||||
// Check whether the access to the local contacts has not been already asked
|
||||
// and check that the user has decided to use or not to use an identity server
|
||||
if ([CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusNotDetermined
|
||||
|| !contactsDataSource.mxSession.hasAccountDataIdentityServerValue)
|
||||
if (BuildSettings.allowLocalContactsAccess)
|
||||
{
|
||||
// Allow by default the local contacts sync in order to discover matrix users.
|
||||
// This setting change will trigger the loading of the local contacts, which will automatically
|
||||
// ask user permission to access their local contacts.
|
||||
[MXKAppSettings standardAppSettings].syncLocalContacts = YES;
|
||||
// Check whether the access to the local contacts has not been already asked
|
||||
// and check that the user has decided to use or not to use an identity server
|
||||
if ([CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusNotDetermined
|
||||
|| !contactsDataSource.mxSession.hasAccountDataIdentityServerValue)
|
||||
{
|
||||
// Allow by default the local contacts sync in order to discover matrix users.
|
||||
// This setting change will trigger the loading of the local contacts, which will automatically
|
||||
// ask user permission to access their local contacts.
|
||||
[MXKAppSettings standardAppSettings].syncLocalContacts = YES;
|
||||
}
|
||||
}
|
||||
|
||||
// Observe kAppDelegateDidTapStatusBarNotification.
|
||||
|
|
|
@ -467,7 +467,10 @@
|
|||
}
|
||||
|
||||
// Keep visible the header for the both contact sections, even if their are empty.
|
||||
filteredLocalContactsSection = count++;
|
||||
if (BuildSettings.allowLocalContactsAccess)
|
||||
{
|
||||
filteredLocalContactsSection = count++;
|
||||
}
|
||||
filteredMatrixContactsSection = count++;
|
||||
}
|
||||
else
|
||||
|
@ -479,7 +482,10 @@
|
|||
}
|
||||
|
||||
// Keep visible the local contact header, even if the section is empty.
|
||||
filteredLocalContactsSection = count++;
|
||||
if (BuildSettings.allowLocalContactsAccess)
|
||||
{
|
||||
filteredLocalContactsSection = count++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue