diff options
author | louiz’ <louiz@louiz.org> | 2017-06-28 14:42:33 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-06-28 14:42:33 +0200 |
commit | c5407cf8ce6add6f3534df41398235e93b605ab3 (patch) | |
tree | f62cccb758dde48270cc24257df36bd3f5f89cf8 /src/xmpp/biboumi_component.cpp | |
parent | 13a1ab1878fd6312aea485ded3f5bad59c36f17f (diff) | |
parent | b71ca15a0f9114db38eec23b49d1489a2ff1d0ca (diff) | |
download | biboumi-c5407cf8ce6add6f3534df41398235e93b605ab3.tar.gz biboumi-c5407cf8ce6add6f3534df41398235e93b605ab3.tar.bz2 biboumi-c5407cf8ce6add6f3534df41398235e93b605ab3.tar.xz biboumi-c5407cf8ce6add6f3534df41398235e93b605ab3.zip |
Merge branch 'master' into debian
Diffstat (limited to 'src/xmpp/biboumi_component.cpp')
-rw-r--r-- | src/xmpp/biboumi_component.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp index ca3a887..32f3968 100644 --- a/src/xmpp/biboumi_component.cpp +++ b/src/xmpp/biboumi_component.cpp @@ -18,8 +18,6 @@ #include <biboumi.h> -#include <uuid/uuid.h> - #ifdef SYSTEMD_FOUND # include <systemd/sd-daemon.h> #endif @@ -648,9 +646,9 @@ bool BiboumiComponent::handle_mam_request(const Stanza& stanza) limit = 100; } const auto lines = Database::get_muc_logs(from.bare(), iid.get_local(), iid.get_server(), limit, start, end); - for (const db::MucLogLine& line: lines) + for (const Database::MucLogLine& line: lines) { - if (!line.nick.value().empty()) + if (!line.col<Database::Nick>().empty()) this->send_archived_message(line, to.full(), from.full(), query_id); } this->send_iq_result_full_jid(id, from.full(), to.full()); @@ -659,7 +657,7 @@ bool BiboumiComponent::handle_mam_request(const Stanza& stanza) return false; } -void BiboumiComponent::send_archived_message(const db::MucLogLine& log_line, const std::string& from, const std::string& to, +void BiboumiComponent::send_archived_message(const Database::MucLogLine& log_line, const std::string& from, const std::string& to, const std::string& queryid) { Stanza message("message"); @@ -671,22 +669,22 @@ void BiboumiComponent::send_archived_message(const db::MucLogLine& log_line, con result["xmlns"] = MAM_NS; if (!queryid.empty()) result["queryid"] = queryid; - result["id"] = log_line.uuid.value(); + result["id"] = log_line.col<Database::Uuid>(); XmlSubNode forwarded(result, "forwarded"); forwarded["xmlns"] = FORWARD_NS; XmlSubNode delay(forwarded, "delay"); delay["xmlns"] = DELAY_NS; - delay["stamp"] = utils::to_string(log_line.date.value().timeStamp()); + delay["stamp"] = utils::to_string(log_line.col<Database::Date>()); XmlSubNode submessage(forwarded, "message"); submessage["xmlns"] = CLIENT_NS; - submessage["from"] = from + "/" + log_line.nick.value(); + submessage["from"] = from + "/" + log_line.col<Database::Nick>(); submessage["type"] = "groupchat"; XmlSubNode body(submessage, "body"); - body.set_inner(log_line.body.value()); + body.set_inner(log_line.col<Database::Body>()); } this->send_stanza(message); } @@ -721,7 +719,7 @@ bool BiboumiComponent::handle_room_configuration_form(const XmlNode& query, cons return false; Jid requester(from); - if (!handle_irc_channel_configuration_form(query, requester, to)) + if (!handle_irc_channel_configuration_form(*this, query, requester, to)) return false; Stanza iq("iq"); |