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/bridge | |
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/bridge')
-rw-r--r-- | src/bridge/bridge.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 0d6ade3..2da1d96 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -254,15 +254,16 @@ void Bridge::send_channel_message(const Iid& iid, const std::string& body) else irc->send_channel_message(iid.get_local(), line); + std::string uuid; #ifdef USE_DATABASE const auto xmpp_body = this->make_xmpp_body(line); if (this->record_history) - Database::store_muc_message(this->get_bare_jid(), iid, std::chrono::system_clock::now(), + uuid = Database::store_muc_message(this->get_bare_jid(), iid, std::chrono::system_clock::now(), std::get<0>(xmpp_body), irc->get_own_nick()); #endif for (const auto& resource: this->resources_in_chan[iid.to_tuple()]) - this->xmpp.send_muc_message(std::to_string(iid), irc->get_own_nick(), - this->make_xmpp_body(line), this->user_jid + "/" + resource); + this->xmpp.send_muc_message(std::to_string(iid), irc->get_own_nick(), this->make_xmpp_body(line), + this->user_jid + "/" + resource, uuid); } } @@ -839,8 +840,8 @@ void Bridge::send_message(const Iid& iid, const std::string& nick, const std::st #endif for (const auto& resource: this->resources_in_chan[iid.to_tuple()]) { - this->xmpp.send_muc_message(std::to_string(iid), nick, - this->make_xmpp_body(body, encoding), this->user_jid + "/" + resource); + this->xmpp.send_muc_message(std::to_string(iid), nick, this->make_xmpp_body(body, encoding), + this->user_jid + "/" + resource, {}); } } |