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
Branches
No related tags found
No related merge requests found
......@@ -76,7 +76,6 @@ ContactList::addContact(const dht::InfoHash& h, bool confirmed)
trust_.setCertificateStatus(hStr, tls::TrustStore::PermissionStatus::ALLOWED);
saveContacts();
callbacks_.contactAdded(hStr, c->second.confirmed);
//emitSignal<DRing::ConfigurationSignal::ContactAdded>(account_.get().getAccountID(), hStr, c->second.confirmed);
//syncDevices();
return true;
}
......@@ -99,7 +98,6 @@ ContactList::removeContact(const dht::InfoHash& h, bool ban)
saveTrustRequests();
saveContacts();
callbacks_.contactRemoved(uri, ban);
//emitSignal<DRing::ConfigurationSignal::ContactRemoved>(account_.get().getAccountID(), uri, ban);
//syncDevices();
return true;
}
......@@ -131,6 +129,9 @@ ContactList::setContacts(const std::map<dht::InfoHash, Contact>& contacts)
{
contacts_ = contacts;
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment