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.
pull/726/head
Nicolas Werner 3 years ago
parent e88ab89c18
commit 1b82b8242b
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 8
      src/Cache.cpp
  2. 3
      src/Cache_p.h

@ -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,

@ -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);

Loading…
Cancel
Save