Privacy: Do not try to scan local contacts in background when the user has not decided yet to use or not an identity server.

But try to scan when the user opens a screen with a list of contacts
This commit is contained in:
manuroe
2019-10-10 15:05:39 +02:00
parent ee1764d424
commit 94011e5cae
3 changed files with 33 additions and 8 deletions
@@ -149,8 +149,10 @@
// Screen tracking
[[Analytics sharedInstance] trackScreen:_screenName];
// Check whether the access to the local contacts has not been already asked.
if ([CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts] == CNAuthorizationStatusNotDetermined)
// 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