summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-06-22 21:33:58 +0200
committerlouiz’ <louiz@louiz.org>2018-06-22 21:35:46 +0200
commit0b8738d87aa101117c7681ade41f8527ad515d3c (patch)
tree446aa4453448dc3a4fc17ad51ab18aa84cbb0d0e /src
parent21a79b7bad51e755cee2890aa6d0bec5dd45f901 (diff)
downloadbiboumi-0b8738d87aa101117c7681ade41f8527ad515d3c.tar.gz
biboumi-0b8738d87aa101117c7681ade41f8527ad515d3c.tar.bz2
biboumi-0b8738d87aa101117c7681ade41f8527ad515d3c.tar.xz
biboumi-0b8738d87aa101117c7681ade41f8527ad515d3c.zip
Archive the Mode messages, except if they are received for an unjoined chan
fix #3362
Diffstat (limited to 'src')
-rw-r--r--src/bridge/bridge.cpp4
-rw-r--r--src/bridge/bridge.hpp2
-rw-r--r--src/irc/irc_client.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index 7a0157a..b6081d5 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -816,7 +816,7 @@ void Bridge::send_irc_version_request(const std::string& irc_hostname, const std
this->add_waiting_irc(std::move(cb));
}
-void Bridge::send_message(const Iid& iid, const std::string& nick, const std::string& body, const bool muc)
+void Bridge::send_message(const Iid& iid, const std::string& nick, const std::string& body, const bool muc, const bool log)
{
const auto encoding = in_encoding_for(*this, iid);
std::string uuid{};
@@ -824,7 +824,7 @@ void Bridge::send_message(const Iid& iid, const std::string& nick, const std::st
{
#ifdef USE_DATABASE
const auto xmpp_body = this->make_xmpp_body(body, encoding);
- if (!nick.empty() && this->record_history)
+ if (log && this->record_history)
uuid = Database::store_muc_message(this->get_bare_jid(), iid.get_local(), iid.get_server(), std::chrono::system_clock::now(),
std::get<0>(xmpp_body), nick);
#endif
diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp
index 04397c6..cb48a96 100644
--- a/src/bridge/bridge.hpp
+++ b/src/bridge/bridge.hpp
@@ -166,7 +166,7 @@ public:
/**
* Send a MUC message from some participant
*/
- void send_message(const Iid& iid, const std::string& nick, const std::string& body, const bool muc);
+ void send_message(const Iid& iid, const std::string& nick, const std::string& body, const bool muc, const bool log=true);
/**
* Send a presence of type error, from a room.
*/
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index 0f3d43c..96fb4ef 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -1154,7 +1154,7 @@ void IrcClient::on_channel_mode(const IrcMessage& message)
}
this->bridge.send_message(iid, "", "Mode " + iid.get_local() +
" [" + mode_arguments + "] by " + user.nick,
- true);
+ true, this->is_channel_joined(iid.get_local()));
const IrcChannel* channel = this->get_channel(iid.get_local());
if (!channel)
return;