add archive_expires_after option

This commit is contained in:
Luca Matei Pintilie
2026-01-10 18:59:34 +01:00
committed by mathieui
parent 4de88b5160
commit 6ed185a8a5
11 changed files with 249 additions and 0 deletions
+9
View File
@@ -2,6 +2,7 @@
#ifdef USE_DATABASE
#include <database/select_query.hpp>
#include <database/delete_query.hpp>
#include <database/save.hpp>
#include <database/database.hpp>
#include <utils/get_first_non_empty.hpp>
@@ -317,6 +318,14 @@ std::vector<Database::RosterItem> Database::get_full_roster()
return query.execute(*Database::db);
}
void Database::delete_old_muclines(const long& seconds)
{
auto query = DeleteQuery(Database::muc_log_lines.get_name());
query << " WHERE " << Database::Date{} << "<" << seconds;
query.execute(*Database::db);
}
void Database::close()
{
Database::db = nullptr;
+1
View File
@@ -153,6 +153,7 @@ class Database
static void delete_roster_item(const std::string& local, const std::string& remote);
static std::vector<Database::RosterItem> get_contact_list(const std::string& local);
static std::vector<Database::RosterItem> get_full_roster();
static void delete_old_muclines(const long& seconds);
static void close();
static void open(const std::string& filename);