Skip to content
Snippets Groups Projects
Commit 93cde493 authored by Andreas Hatziiliou's avatar Andreas Hatziiliou Committed by Adrien Béraud
Browse files

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
parent cb829676
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment