Reload once contacts to repair close friends.

This commit is contained in:
levlam 2023-05-03 20:55:28 +03:00
parent fb57555f3d
commit 86946c6b1e
2 changed files with 11 additions and 0 deletions

View File

@ -10000,6 +10000,12 @@ void ContactsManager::on_load_contacts_from_database(string value) {
return;
}
if (log_event_get_version(value) < static_cast<int32>(Version::AddUserFlags2)) {
next_contacts_sync_date_ = 0;
save_next_contacts_sync_date();
reload_contacts(true);
}
LOG(INFO) << "Successfully loaded " << user_ids.size() << " contacts from database";
load_contact_users_multipromise_.add_promise(PromiseCreator::lambda(

View File

@ -200,6 +200,11 @@ Status log_event_parse(T &data, Slice slice) {
return parser.get_status();
}
inline int32 log_event_get_version(Slice slice) {
LogEventParser parser(slice);
return parser.version();
}
template <class T>
BufferSlice log_event_store_impl(const T &data, const char *file, int line) {
LogEventStorerCalcLength storer_calc_length;