mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 23:05:48 +02:00
contactmodel: fix contact initialization when linking a new device
getContacts() is called before sync is finished. This should be done like conversations, after first initializing. This fix the presence showing after sync. GitLab: #1627 Change-Id: I4ec9b7e34b5bd93b9ae4437e6c6719dbc3b78a98
This commit is contained in:
parent
665af7c0c3
commit
acc0c97234
3 changed files with 9 additions and 1 deletions
|
@ -531,11 +531,12 @@ AccountModelPimpl::slotAccountStatusChanged(const QString& accountID,
|
|||
if (status != api::account::Status::INITIALIZING
|
||||
&& accountInfo.status == api::account::Status::INITIALIZING) {
|
||||
// Detect when a new account is generated (keys are ready). During
|
||||
// the generation, a Ring account got the "INITIALIZING" status.
|
||||
// the generation, an account got the "INITIALIZING" status.
|
||||
// When keys are generated, the status will change.
|
||||
// The account is already added and initialized. Just update details from daemon
|
||||
updateAccountDetails(accountInfo);
|
||||
// This will load swarms as the account was not loaded before.
|
||||
accountInfo.contactModel->initContacts();
|
||||
accountInfo.conversationModel->initConversations();
|
||||
Q_EMIT linked.accountAdded(accountID);
|
||||
} else if (!accountInfo.profileInfo.uri.isEmpty()) {
|
||||
|
|
|
@ -62,6 +62,8 @@ public:
|
|||
const BehaviorController& behaviorController);
|
||||
~ContactModel();
|
||||
|
||||
void initContacts();
|
||||
|
||||
/**
|
||||
* Ask the daemon to add a contact.
|
||||
* @param contactInfo
|
||||
|
|
|
@ -237,6 +237,11 @@ ContactModel::ContactModel(const account::Info& owner,
|
|||
|
||||
ContactModel::~ContactModel() {}
|
||||
|
||||
void
|
||||
ContactModel::initContacts() {
|
||||
pimpl_->fillWithJamiContacts();
|
||||
}
|
||||
|
||||
const ContactModel::ContactInfoMap&
|
||||
ContactModel::getAllContacts() const
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue