summaryrefslogtreecommitdiff
path: root/src/database
diff options
context:
space:
mode:
Diffstat (limited to 'src/database')
-rw-r--r--src/database/database.cpp4
-rw-r--r--src/database/database.hpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp
index f7d309b..71b0c37 100644
--- a/src/database/database.cpp
+++ b/src/database/database.cpp
@@ -20,7 +20,7 @@ void Database::open(const std::string& filename, const std::string& db_type)
"database="s + filename);
if (new_db->needsUpgrade())
new_db->upgrade();
- Database::db.reset(new_db.release());
+ Database::db = std::move(new_db);
} catch (const litesql::DatabaseError& e) {
log_error("Failed to open database ", filename, ". ", e.what());
throw;
@@ -130,7 +130,7 @@ void Database::store_muc_message(const std::string& owner, const Iid& iid,
line.owner = owner;
line.ircChanName = iid.get_local();
line.ircServerName = iid.get_server();
- line.date = date.time_since_epoch().count() / 1'000'000'000;
+ line.date = std::chrono::duration_cast<std::chrono::seconds>(date.time_since_epoch()).count();
line.body = body;
line.nick = nick;
diff --git a/src/database/database.hpp b/src/database/database.hpp
index 6823574..1665a9a 100644
--- a/src/database/database.hpp
+++ b/src/database/database.hpp
@@ -49,7 +49,7 @@ public:
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="");
+ int limit=-1, const std::string& start="", const std::string& end="");
static void store_muc_message(const std::string& owner, const Iid& iid,
time_point date, const std::string& body, const std::string& nick);