summaryrefslogtreecommitdiff
path: root/src/database/database.hpp
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2016-12-21 21:25:17 +0100
committerJonas Smedegaard <dr@jones.dk>2016-12-21 21:25:17 +0100
commitdc1ad45aea9a10007a31ae449b1e0fe352a8a6cd (patch)
treeeb233ce97fc828e2edba69a82a1e7314b92771d3 /src/database/database.hpp
parenta077b304b27d21bf635ef4f31a2a0447d3b14d11 (diff)
parentf820d86aadb7a5473bcc0a0a3669732ab0182555 (diff)
downloadbiboumi-dc1ad45aea9a10007a31ae449b1e0fe352a8a6cd.tar.gz
biboumi-dc1ad45aea9a10007a31ae449b1e0fe352a8a6cd.tar.bz2
biboumi-dc1ad45aea9a10007a31ae449b1e0fe352a8a6cd.tar.xz
biboumi-dc1ad45aea9a10007a31ae449b1e0fe352a8a6cd.zip
Merge tag 'upstream/4.0'
Upstream version 4.0 # gpg: Signature made Wed Dec 21 21:25:11 2016 CET # gpg: using RSA key 2C7C3146C1A00121 # gpg: Good signature from "Jonas Smedegaard <dr@jones.dk>" # gpg: aka "Jonas Smedegaard <jonas@homebase.dk>" # gpg: aka "Jonas Smedegaard <js@debian.org>" # gpg: aka "[jpeg image of size 4165]"
Diffstat (limited to 'src/database/database.hpp')
-rw-r--r--src/database/database.hpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/database/database.hpp b/src/database/database.hpp
index 7173bcd..6823574 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;
@@ -32,6 +36,7 @@ public:
* Return the object from the db. Create it beforehand (with all default
* values) if it is not already present.
*/
+ static db::GlobalOptions get_global_options(const std::string& owner);
static db::IrcServerOptions get_irc_server_options(const std::string& owner,
const std::string& server);
static db::IrcChannelOptions get_irc_channel_options(const std::string& owner,
@@ -40,12 +45,20 @@ public:
static db::IrcChannelOptions get_irc_channel_options_with_server_default(const std::string& owner,
const std::string& server,
const std::string& channel);
+ static db::IrcChannelOptions get_irc_channel_options_with_server_and_global_default(const std::string& owner,
+ const std::string& server,
+ const std::string& channel);
+ static std::vector<db::MucLogLine> get_muc_logs(const std::string& owner, const std::string& chan_name, const std::string& server,
+ int limit=-1, const std::string& before="", const std::string& after="");
+ 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 */