summary refs log tree commit diff
path: root/src/ChatPage.cpp
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-08-25 21:08:43 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-08-25 21:08:43 +0300
commit345dca35444771267f51fe011c62e5d135695069 (patch)
treea36cfbc42308c02caf608afa6049b7423e85614e /src/ChatPage.cpp
parentBump version to v0.5.4 (diff)
downloadnheko-345dca35444771267f51fe011c62e5d135695069.tar.xz
Add method to delete old messages periodically
fixes #413
Diffstat (limited to '')
-rw-r--r--src/ChatPage.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp
index 9f408a73..250d106d 100644
--- a/src/ChatPage.cpp
+++ b/src/ChatPage.cpp
@@ -1070,6 +1070,11 @@ ChatPage::trySync()
 
                           emit syncTopBar(updates);
                           emit syncRoomlist(updates);
+
+                          cache::client()->deleteOldData();
+                  } catch (const lmdb::map_full_error &e) {
+                          nhlog::db()->error("lmdb is full: {}", e.what());
+                          cache::client()->deleteOldData();
                   } catch (const lmdb::error &e) {
                           nhlog::db()->error("saving sync response: {}", e.what());
                   }