From 1b82b8242b1290b3ce39f932597e8cd3854b5e82 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 11 Sep 2021 01:29:09 +0200 Subject: [PATCH] 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. --- src/Cache.cpp | 8 -------- src/Cache_p.h | 3 --- 2 files changed, 11 deletions(-) diff --git a/src/Cache.cpp b/src/Cache.cpp index d009c0d3..84e2ddc2 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -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 &user_ids) -{ - for (const auto &user_id : user_ids) - db.del(txn, user_id); -} - void Cache::markUserKeysOutOfDate(lmdb::txn &txn, lmdb::dbi &db, diff --git a/src/Cache_p.h b/src/Cache_p.h index 6190413f..7780c80f 100644 --- a/src/Cache_p.h +++ b/src/Cache_p.h @@ -55,9 +55,6 @@ public: lmdb::dbi &db, const std::vector &user_ids, const std::string &sync_token); - void deleteUserKeys(lmdb::txn &txn, - lmdb::dbi &db, - const std::vector &user_ids); void query_keys(const std::string &user_id, std::function cb);