diff options
author | louiz’ <louiz@louiz.org> | 2016-08-13 01:46:11 +0200 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2016-08-13 01:46:11 +0200 |
commit | 787563722c36bc63223655d337d98caac82dc44f (patch) | |
tree | 7bbc711663dec10f55014f13da0221ab7b1b74de /src/bridge | |
parent | 8ec823be4fc587abb7282a06a12f9df9c37810d2 (diff) | |
download | biboumi-787563722c36bc63223655d337d98caac82dc44f.tar.gz biboumi-787563722c36bc63223655d337d98caac82dc44f.tar.bz2 biboumi-787563722c36bc63223655d337d98caac82dc44f.tar.xz biboumi-787563722c36bc63223655d337d98caac82dc44f.zip |
Only save the messages into the db if we are actually using a db
Diffstat (limited to 'src/bridge')
-rw-r--r-- | src/bridge/bridge.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 1812611..23fc71d 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -225,10 +225,11 @@ void Bridge::send_channel_message(const Iid& iid, const std::string& body) else irc->send_channel_message(iid.get_local(), line); +#ifdef USE_DATABASE const auto xmpp_body = this->make_xmpp_body(line); 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); @@ -583,10 +584,11 @@ void Bridge::send_message(const Iid& iid, const std::string& nick, const std::st const auto encoding = in_encoding_for(*this, iid); if (muc) { +#ifdef USE_DATABASE const auto xmpp_body = this->make_xmpp_body(body, encoding); Database::store_muc_message(this->get_bare_jid(), iid, std::chrono::system_clock::now(), std::get<0>(xmpp_body), nick); - +#endif for (const auto& resource: this->resources_in_chan[iid.to_tuple()]) { this->xmpp.send_muc_message(std::to_string(iid), nick, |