add archive_expires_after option
This commit is contained in:
committed by
mathieui
parent
4de88b5160
commit
6ed185a8a5
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user