1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-03 22:35:45 +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:
Sébastien Blin 2024-05-27 11:47:43 -04:00
parent 665af7c0c3
commit acc0c97234
3 changed files with 9 additions and 1 deletions

View file

@ -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()) {

View file

@ -62,6 +62,8 @@ public:
const BehaviorController& behaviorController);
~ContactModel();
void initContacts();
/**
* Ask the daemon to add a contact.
* @param contactInfo

View file

@ -237,6 +237,11 @@ ContactModel::ContactModel(const account::Info& owner,
ContactModel::~ContactModel() {}
void
ContactModel::initContacts() {
pimpl_->fillWithJamiContacts();
}
const ContactModel::ContactInfoMap&
ContactModel::getAllContacts() const
{