aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
diff options
context:
space:
mode:
authorTobias Fella <fella@posteo.de>2021-12-10 17:01:05 +0100
committerTobias Fella <fella@posteo.de>2021-12-10 17:01:05 +0100
commit6b29d759a47012eef74948e72c0d0395eb6bf282 (patch)
tree69e6512eb984a5d71055fcdb441e95d06ecae5bb /lib/room.cpp
parent4a17403f9adad9b4390f7e0010c0f7e23a718f7b (diff)
downloadlibquotient-6b29d759a47012eef74948e72c0d0395eb6bf282.tar.gz
libquotient-6b29d759a47012eef74948e72c0d0395eb6bf282.zip
Remove data from database when leaving room
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 0a4fcc68..a46892f3 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -461,6 +461,10 @@ Room::Room(Connection* connection, QString id, JoinState initialJoinState)
}
});
d->loadMegOlmSessions();
+
+ connect(this, &Room::beforeDestruction, this, [=](){
+ connection->database()->clearRoomData(id);
+ });
#endif
qCDebug(STATE) << "New" << terse << initialJoinState << "Room:" << id;
}