diff --git a/src/Cache_p.h b/src/Cache_p.h
index 0d66a608..892b66a5 100644
--- a/src/Cache_p.h
+++ b/src/Cache_p.h
@@ -52,6 +52,10 @@ public:
static QString displayName(const QString &room_id, const QString &user_id);
static QString avatarUrl(const QString &room_id, const QString &user_id);
+ // presence
+ mtx::presence::PresenceState presenceState(const std::string &user_id);
+ std::string statusMessage(const std::string &user_id);
+
static void removeDisplayName(const QString &room_id, const QString &user_id);
static void removeAvatarUrl(const QString &room_id, const QString &user_id);
@@ -377,6 +381,10 @@ private:
void saveInvites(lmdb::txn &txn,
const std::map<std::string, mtx::responses::InvitedRoom> &rooms);
+ void savePresence(
+ lmdb::txn &txn,
+ const std::vector<mtx::events::Event<mtx::events::presence::Presence>> &presenceUpdates);
+
//! Sends signals for the rooms that are removed.
void removeLeftRooms(lmdb::txn &txn,
const std::map<std::string, mtx::responses::LeftRoom> &rooms)
@@ -430,6 +438,11 @@ private:
return lmdb::dbi::open(txn, std::string(room_id + "/mentions").c_str(), MDB_CREATE);
}
+ lmdb::dbi getPresenceDb(lmdb::txn &txn)
+ {
+ return lmdb::dbi::open(txn, "presence", MDB_CREATE);
+ }
+
//! Retrieves or creates the database that stores the open OLM sessions between our device
//! and the given curve25519 key which represents another device.
//!
|