summary refs log tree commit diff
path: root/include/Cache.h
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-04-22 12:26:41 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-04-22 12:26:41 +0300
commitc0e355f485b3aef8feaa8f2061b0eda9ded67a0a (patch)
tree5f4bc671ba394014b798429099fae16212ab6bc8 /include/Cache.h
parentStrip whitespace from room names for QuickSwitcher (diff)
downloadnheko-c0e355f485b3aef8feaa8f2061b0eda9ded67a0a.tar.xz
Properly clean stale invites
Diffstat (limited to 'include/Cache.h')
-rw-r--r--include/Cache.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/Cache.h b/include/Cache.h

index 9a151aba..78a35a65 100644 --- a/include/Cache.h +++ b/include/Cache.h
@@ -155,6 +155,7 @@ public: void deleteData(); + void removeInvite(lmdb::txn &txn, const std::string &room_id); void removeInvite(const std::string &room_id); void removeRoom(lmdb::txn &txn, const std::string &roomid); void removeRoom(const std::string &roomid); @@ -335,8 +336,12 @@ private: void removeLeftRooms(lmdb::txn &txn, const std::map<std::string, mtx::responses::LeftRoom> &rooms) { - for (const auto &room : rooms) + for (const auto &room : rooms) { removeRoom(txn, room.first); + + // Clean up leftover invites. + removeInvite(txn, room.first); + } } lmdb::dbi getInviteStatesDb(lmdb::txn &txn, const std::string &room_id)