Fixed missing presence on contacts at startup sometimes

This commit is contained in:
Sylvain Berfini 2018-12-06 16:20:39 +01:00
parent fc5da7f57d
commit 0ef866c3e3

View file

@ -236,10 +236,17 @@ class AsyncContactsLoader extends AsyncTask<Void, Void, AsyncContactsLoader.Asyn
ContactsManager.getInstance().getContactsListeners()) {
listener.onContactsUpdated();
}
for (LinphoneContact contact : data.contacts) {
contact.createOrUpdateFriendFromNativeContact();
}
// Now that contact fetching is asynchronous, this is required to ensure
// presence subscription event will be sent with all friends
for (FriendList list : LinphoneManager.getLc().getFriendsLists()) {
list.updateSubscriptions();
}
ContactsManager.getInstance().setContacts(data.contacts);
ContactsManager.getInstance().setSipContacts(data.sipContacts);
}