update contacts-cache users for MessageContact

Since contacts-cache now uses MessageContact, update its users
This commit is contained in:
Dirk-Jan C. Binnema
2022-02-20 00:35:43 +02:00
parent 4b9814be25
commit 7822d2633e
3 changed files with 10 additions and 14 deletions

View File

@ -522,7 +522,7 @@ Server::Private::contacts_handler(const Parameters& params)
auto rank{0};
Sexp::List contacts;
store().contacts_cache().for_each([&](const ContactInfo& ci) {
store().contacts_cache().for_each([&](const MessageContact& ci) {
rank++;
/* since the last time we got some contacts */
@ -532,11 +532,12 @@ Server::Private::contacts_handler(const Parameters& params)
if (personal && !ci.personal)
return;
/* only include newer-than-x contacts */
if (after > ci.last_seen)
if (after > ci.message_date)
return;
Sexp::List contact;
contact.add_prop(":address", Sexp::make_string(ci.full_address));
contact.add_prop(":address",
Sexp::make_string(ci.display_name()));
contact.add_prop(":rank", Sexp::make_number(rank));
contacts.add(Sexp::make_list(std::move(contact)));