summary refs log tree commit diff
path: root/src/Cache.cc
diff options
context:
space:
mode:
authorMax Sandholm <max@sandholm.org>2017-10-01 19:49:36 +0300
committermujx <mujx@users.noreply.github.com>2017-10-01 19:49:36 +0300
commit7ad45d8d6448c60b4c81c80fa8d6d81afd6e4a02 (patch)
tree821124200c7dac85128790115d527791c1fc4945 /src/Cache.cc
parentMore badges (diff)
downloadnheko-7ad45d8d6448c60b4c81c80fa8d6d81afd6e4a02.tar.xz
React to externally left and joined rooms, and add "leave room" button in room menu (#75)
* Initial "join room" feature.
* React correctly to remotely joined rooms.
* Leaving rooms implemented both locally using the room menu
   in nheko, and reacting properly when leaving a room remotely 
   from another client.
Diffstat (limited to 'src/Cache.cc')
-rw-r--r--src/Cache.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Cache.cc b/src/Cache.cc

index bda81316..5ed77086 100644 --- a/src/Cache.cc +++ b/src/Cache.cc
@@ -153,6 +153,16 @@ Cache::insertRoomState(lmdb::txn &txn, const QString &roomid, const RoomState &s } } +void +Cache::removeRoom(const QString &roomid) +{ + auto txn = lmdb::txn::begin(env_, nullptr, 0); + + lmdb::dbi_del(txn, roomDb_, lmdb::val(roomid.toUtf8(), roomid.toUtf8().size()), nullptr); + + txn.commit(); +} + QMap<QString, RoomState> Cache::states() {