Skip to content
Snippets Groups Projects
Commit 78fbe5d6 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Adrien Béraud
Browse files

contact: remove contactAdded signal


Remove contactAdded signal when adding a TEMPORARY contact. This signal is
emitted after receiving signal from the daemon, so we don't need it
two times. It allows to have updated contact information (particularly contact
type).

Change-Id: I2eb48178ccf0959acbc0e8439cfa6173011797f6
Reviewed-by: default avatarSebastien Blin <sebastien.blin@savoirfairelinux.com>
parent ea3e77c3
Branches
No related tags found
No related merge requests found
......@@ -273,7 +273,8 @@ ContactModel::addContact(contact::Info contactInfo)
iter->second.profileInfo = contactInfo.profileInfo;
}
}
if (profile.type == profile::Type::TEMPORARY)
return;
emit contactAdded(profile.uri);
}
......@@ -690,8 +691,11 @@ ContactModelPimpl::addToContacts(ContactMethod* cm, const profile::Type& type, b
contactInfo.isPresent = cm->isPresent();
contactInfo.profileInfo.type = type; // Because PENDING should not be stored in the database
auto iter = contacts.find(contactInfo.profileInfo.uri);
if (iter != contacts.end())
if (iter != contacts.end()) {
auto info = iter->second;
contactInfo.registeredName = info.registeredName;
iter->second = contactInfo;
}
else
contacts.emplace_hint(iter, contactInfo.profileInfo.uri, contactInfo);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment