1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-10 12:03:18 +02:00

user_search: fix issue with user display incorrectly being updated

When searching for a user, if the user was found, a signal would be
sent to update the display name with incorrect formatting across the
application.

Change-Id: I20a453e2eddf1e1a402985ff741c8e7c7ea6f99f
This commit is contained in:
Andreas Hatziiliou 2024-10-07 16:21:33 -04:00 committed by Adrien Béraud
parent cb829676e3
commit 93cde493d8

View file

@ -240,7 +240,8 @@ ContactModel::ContactModel(const account::Info& owner,
ContactModel::~ContactModel() {}
void
ContactModel::initContacts() {
ContactModel::initContacts()
{
pimpl_->fillWithJamiContacts();
}
@ -944,20 +945,21 @@ ContactModelPimpl::slotRegisteredNameFound(const QString& accountId,
return;
if (status == 0 /* SUCCESS */) {
QString foundName = registeredName.toLower();
std::lock_guard<std::mutex> lk(contactsMtx_);
if (contacts.find(uri) != contacts.end()) {
// update contact and remove temporary item
contacts[uri].registeredName = registeredName;
contacts[uri].registeredName = foundName;
searchResult.clear();
} else {
nonContactLookup_[uri] = registeredName;
nonContactLookup_[uri] = foundName;
if ((searchQuery != uri && searchQuery != registeredName) || searchQuery.isEmpty()) {
// we are notified that a previous lookup ended
return;
}
// Update the temporary item
lrc::api::profile::Info profileInfo = {uri, "", "", profile::Type::TEMPORARY};
searchResult[uri] = {profileInfo, registeredName, false, false};
searchResult[uri] = {profileInfo, foundName, false, false};
}
} else {
{