diff options
author | louiz’ <louiz@louiz.org> | 2016-08-12 16:39:19 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-08-12 16:39:19 +0200 |
commit | 8ec823be4fc587abb7282a06a12f9df9c37810d2 (patch) | |
tree | 7ce77108ac2e6da63ee89a4f5fb6dbc97fe8a67f /src/database/database.hpp | |
parent | 7ffe278e0556d222291840dc91c785ccf824fee5 (diff) | |
download | biboumi-8ec823be4fc587abb7282a06a12f9df9c37810d2.tar.gz biboumi-8ec823be4fc587abb7282a06a12f9df9c37810d2.tar.bz2 biboumi-8ec823be4fc587abb7282a06a12f9df9c37810d2.tar.xz biboumi-8ec823be4fc587abb7282a06a12f9df9c37810d2.zip |
Save received and sent messages into the database
Diffstat (limited to 'src/database/database.hpp')
-rw-r--r-- | src/database/database.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/database/database.hpp b/src/database/database.hpp index 7173bcd..b11332e 100644 --- a/src/database/database.hpp +++ b/src/database/database.hpp @@ -9,10 +9,14 @@ #include <memory> #include <litesql.hpp> +#include <chrono> + +class Iid; class Database { public: + using time_point = std::chrono::system_clock::time_point; Database() = default; ~Database() = default; @@ -41,11 +45,15 @@ public: const std::string& server, const std::string& channel); + static void store_muc_message(const std::string& owner, const Iid& iid, + time_point date, const std::string& body, const std::string& nick); + static void close(); static void open(const std::string& filename, const std::string& db_type="sqlite3"); private: + static std::string gen_uuid(); static std::unique_ptr<db::BibouDB> db; }; #endif /* USE_DATABASE */ |