Keep identities for users cached

There is not really a reason to stop tracking them, just because the
server says so. We might still want to show a users profile, etc.
This commit is contained in:
Nicolas Werner 2021-09-11 01:29:09 +02:00
parent e88ab89c18
commit 1b82b8242b
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
2 changed files with 0 additions and 11 deletions

View File

@ -1572,7 +1572,6 @@ Cache::saveState(const mtx::responses::Sync &res)
savePresence(txn, res.presence);
markUserKeysOutOfDate(txn, userKeyCacheDb, res.device_lists.changed, currentBatchToken);
deleteUserKeys(txn, userKeyCacheDb, res.device_lists.left);
removeLeftRooms(txn, res.rooms.leave);
@ -4124,13 +4123,6 @@ Cache::updateUserKeys(const std::string &sync_token, const mtx::responses::Query
}
}
void
Cache::deleteUserKeys(lmdb::txn &txn, lmdb::dbi &db, const std::vector<std::string> &user_ids)
{
for (const auto &user_id : user_ids)
db.del(txn, user_id);
}
void
Cache::markUserKeysOutOfDate(lmdb::txn &txn,
lmdb::dbi &db,

View File

@ -55,9 +55,6 @@ public:
lmdb::dbi &db,
const std::vector<std::string> &user_ids,
const std::string &sync_token);
void deleteUserKeys(lmdb::txn &txn,
lmdb::dbi &db,
const std::vector<std::string> &user_ids);
void query_keys(const std::string &user_id,
std::function<void(const UserKeyCache &, mtx::http::RequestErr)> cb);