Commit 99aece5b authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Sébastien Blin
Browse files

contactmodel: fix the issue when user doing search using ring Id

- when user have the contact in the list and search its ring id,
  both the contact in list and temporary contact will be found,
  when user add the temporary contact, original contact will be replaced.
- this patch fix that issue

Change-Id: Ib756e350d6980d8d198adf30d1e903ae97edc506
parent f934e02f
......@@ -392,6 +392,11 @@ ContactModelPimpl::searchRingContact(const URI& query)
std::string uriID = query.format(URI::Section::USER_INFO | URI::Section::HOSTNAME | URI::Section::PORT).toStdString();
if (query.protocolHint() == URI::ProtocolHint::RING) {
// no lookup, this is a ring infoHash
for (auto &i : contacts) {
if (i.second.profileInfo.uri == uriID) {
auto& temporaryContact = contacts[""];
temporaryContact.profileInfo.uri = uriID;
temporaryContact.profileInfo.alias = uriID;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment