Archive the Mode messages, except if they are received for an unjoined chan
fix #3362
This commit is contained in:
@@ -816,7 +816,7 @@ void Bridge::send_irc_version_request(const std::string& irc_hostname, const std
|
|||||||
this->add_waiting_irc(std::move(cb));
|
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);
|
const auto encoding = in_encoding_for(*this, iid);
|
||||||
std::string uuid{};
|
std::string uuid{};
|
||||||
@@ -824,7 +824,7 @@ void Bridge::send_message(const Iid& iid, const std::string& nick, const std::st
|
|||||||
{
|
{
|
||||||
#ifdef USE_DATABASE
|
#ifdef USE_DATABASE
|
||||||
const auto xmpp_body = this->make_xmpp_body(body, encoding);
|
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(),
|
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);
|
std::get<0>(xmpp_body), nick);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Send a MUC message from some participant
|
* 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.
|
* Send a presence of type error, from a room.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1154,7 +1154,7 @@ void IrcClient::on_channel_mode(const IrcMessage& message)
|
|||||||
}
|
}
|
||||||
this->bridge.send_message(iid, "", "Mode " + iid.get_local() +
|
this->bridge.send_message(iid, "", "Mode " + iid.get_local() +
|
||||||
" [" + mode_arguments + "] by " + user.nick,
|
" [" + mode_arguments + "] by " + user.nick,
|
||||||
true);
|
true, this->is_channel_joined(iid.get_local()));
|
||||||
const IrcChannel* channel = this->get_channel(iid.get_local());
|
const IrcChannel* channel = this->get_channel(iid.get_local());
|
||||||
if (!channel)
|
if (!channel)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user