mirror of
https://github.com/nextcloud/talk-android
synced 2025-07-19 18:55:05 +01:00
only check for nc contacts if phonebook on device is not empty
This commit is contained in:
parent
5e1b69bbe6
commit
5b6fd3759f
@ -91,6 +91,7 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
// collect all contacts with phone number
|
||||
val contactsWithNumbers = collectPhoneNumbers()
|
||||
|
||||
if(contactsWithNumbers.isNotEmpty()){
|
||||
val currentLocale = ConfigurationCompat.getLocales(context.resources.configuration)[0].country
|
||||
|
||||
val map = mutableMapOf<String, Any>()
|
||||
@ -113,18 +114,15 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
||||
}
|
||||
|
||||
override fun onNext(foundContacts: ContactsByNumberOverall) {
|
||||
Log.d(javaClass.simpleName, "next")
|
||||
|
||||
// todo update
|
||||
up(foundContacts)
|
||||
}
|
||||
|
||||
override fun onError(e: Throwable) {
|
||||
// TODO error handling
|
||||
Log.d(javaClass.simpleName, "error")
|
||||
Log.e(javaClass.simpleName, "Failed to searchContactsByPhoneNumber", e)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// store timestamp
|
||||
appPreferences.setPhoneBookIntegrationLastRun(System.currentTimeMillis())
|
||||
|
Loading…
Reference in New Issue
Block a user