Skip to content
Snippets Groups Projects
Commit f73decad authored by Sébastien Blin's avatar Sébastien Blin
Browse files

contact_list: setContacts must call contactAdded()

Because setContacts() just change the contact list but never notify
the client, the client can't know the contacts from the new account.

Change-Id: I02e27f3b768dd7def661d3568a796a91eaa78751
Gitlab: #230
parent 971b9197
No related branches found
No related tags found
No related merge requests found
...@@ -76,7 +76,6 @@ ContactList::addContact(const dht::InfoHash& h, bool confirmed) ...@@ -76,7 +76,6 @@ ContactList::addContact(const dht::InfoHash& h, bool confirmed)
trust_.setCertificateStatus(hStr, tls::TrustStore::PermissionStatus::ALLOWED); trust_.setCertificateStatus(hStr, tls::TrustStore::PermissionStatus::ALLOWED);
saveContacts(); saveContacts();
callbacks_.contactAdded(hStr, c->second.confirmed); callbacks_.contactAdded(hStr, c->second.confirmed);
//emitSignal<DRing::ConfigurationSignal::ContactAdded>(account_.get().getAccountID(), hStr, c->second.confirmed);
//syncDevices(); //syncDevices();
return true; return true;
} }
...@@ -99,7 +98,6 @@ ContactList::removeContact(const dht::InfoHash& h, bool ban) ...@@ -99,7 +98,6 @@ ContactList::removeContact(const dht::InfoHash& h, bool ban)
saveTrustRequests(); saveTrustRequests();
saveContacts(); saveContacts();
callbacks_.contactRemoved(uri, ban); callbacks_.contactRemoved(uri, ban);
//emitSignal<DRing::ConfigurationSignal::ContactRemoved>(account_.get().getAccountID(), uri, ban);
//syncDevices(); //syncDevices();
return true; return true;
} }
...@@ -131,6 +129,9 @@ ContactList::setContacts(const std::map<dht::InfoHash, Contact>& contacts) ...@@ -131,6 +129,9 @@ ContactList::setContacts(const std::map<dht::InfoHash, Contact>& contacts)
{ {
contacts_ = contacts; contacts_ = contacts;
saveContacts(); saveContacts();
// Set contacts is used when creating a new device, so just announce new contacts
for (auto& peer : contacts)
callbacks_.contactAdded(peer.first.toString(), peer.second.confirmed);
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment