summary refs log tree commit diff
path: root/src/Cache_p.h
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2020-06-11 22:28:44 -0400
committerGitHub <noreply@github.com>2020-06-11 22:28:44 -0400
commit21dfb3c0b9fb760391ff76f39a81889db94d50e3 (patch)
treefa33fb0a8be883401da6bc90054be31a42df4db0 /src/Cache_p.h
parentMerge pull request #217 from Nheko-Reborn/reactions (diff)
parentMerge branch origin/master and update translations (diff)
downloadnheko-21dfb3c0b9fb760391ff76f39a81889db94d50e3.tar.xz
Merge pull request #216 from Nheko-Reborn/presence
Presence support
Diffstat (limited to 'src/Cache_p.h')
-rw-r--r--src/Cache_p.h13
1 files changed, 13 insertions, 0 deletions
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. //!