diff options
author | louiz’ <louiz@louiz.org> | 2017-03-30 18:16:44 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-03-30 18:16:44 +0200 |
commit | 7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841 (patch) | |
tree | 0b26c2742f00ac424bd19909695b24e6fd452d52 /src/database | |
parent | 1090f3ceda3a4e87e592fa5aab33ce3e8fb05918 (diff) | |
download | biboumi-7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841.tar.gz biboumi-7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841.tar.bz2 biboumi-7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841.tar.xz biboumi-7f2127a7ea4c49fc1fbcd6cd6fb13e0265f4d841.zip |
Add the archive ID to messages when they are sent to users
This makes us compatible with mam 6.0
fix #3249
Diffstat (limited to 'src/database')
-rw-r--r-- | src/database/database.cpp | 14 | ||||
-rw-r--r-- | src/database/database.hpp | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/database/database.cpp b/src/database/database.cpp index 71b0c37..9f310da 100644 --- a/src/database/database.cpp +++ b/src/database/database.cpp @@ -119,14 +119,16 @@ db::IrcChannelOptions Database::get_irc_channel_options_with_server_and_global_d return coptions; } -void Database::store_muc_message(const std::string& owner, const Iid& iid, - Database::time_point date, - const std::string& body, - const std::string& nick) +std::string Database::store_muc_message(const std::string& owner, const Iid& iid, + Database::time_point date, + const std::string& body, + const std::string& nick) { db::MucLogLine line(*Database::db); - line.uuid = Database::gen_uuid(); + auto uuid = Database::gen_uuid(); + + line.uuid = uuid; line.owner = owner; line.ircChanName = iid.get_local(); line.ircServerName = iid.get_server(); @@ -135,6 +137,8 @@ void Database::store_muc_message(const std::string& owner, const Iid& iid, line.nick = nick; line.update(); + + return uuid; } std::vector<db::MucLogLine> Database::get_muc_logs(const std::string& owner, const std::string& chan_name, const std::string& server, diff --git a/src/database/database.hpp b/src/database/database.hpp index 1665a9a..b08a175 100644 --- a/src/database/database.hpp +++ b/src/database/database.hpp @@ -50,7 +50,7 @@ public: 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& start="", const std::string& end=""); - static void store_muc_message(const std::string& owner, const Iid& iid, + static std::string store_muc_message(const std::string& owner, const Iid& iid, time_point date, const std::string& body, const std::string& nick); static void close(); |