diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 4966b0d4a140be3589074b69dea3ca068ce7b40a..591e947e124d9b86ec67abb9de6cd4b0fde30349 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -988,16 +988,16 @@ void Bridge::send_room_history(const std::string& hostname, const std::string& c this->send_room_history(hostname, chan_name, resource); } -void Bridge::send_room_history(const std::string& hostname, const std::string& chan_name, const std::string& resource) +void Bridge::send_room_history(const std::string& hostname, std::string chan_name, const std::string& resource) { #ifdef USE_DATABASE const auto coptions = Database::get_irc_channel_options_with_server_and_global_default(this->user_jid, hostname, chan_name); const auto lines = Database::get_muc_logs(this->user_jid, chan_name, hostname, coptions.maxHistoryLength.value()); + chan_name.append(utils::empty_if_fixed_server("%" + hostname)); for (const auto& line: lines) { const auto seconds = line.date.value().timeStamp(); - this->xmpp.send_history_message(chan_name + utils::empty_if_fixed_server("%" + hostname), line.nick.value(), - line.body.value(), + this->xmpp.send_history_message(chan_name, line.nick.value(), line.body.value(), this->user_jid + "/" + resource, seconds); } #endif diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index 53d2136c2b5c98316da7c0c722602f91c9dbc83a..f1925455b47f5b89cab8886d42508ce367df2e0c 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -157,7 +157,7 @@ public: * Send the MUC history to the user */ void send_room_history(const std::string& hostname, const std::string& chan_name); - void send_room_history(const std::string& hostname, const std::string& chan_name, const std::string& resource); + void send_room_history(const std::string& hostname, std::string chan_name, const std::string& resource); /** * Send a MUC message from some participant */ diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 1d025f2adbf82911ae7f71fe059211f20d7b5b34..1f562fec1a620357693ec80bfd7346237b8cc804 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -385,7 +385,7 @@ void IrcClient::send_message(IrcMessage&& message) res += message.command; for (const std::string& arg: message.arguments) { - if (arg.find(" ") != std::string::npos || + if (arg.find(' ') != std::string::npos || (!arg.empty() && arg[0] == ':')) { res += " :" + arg; @@ -1080,7 +1080,7 @@ void IrcClient::on_channel_mode(const IrcMessage& message) { // That mode can also be of type B if it is present in the // prefix_to_mode map - for (const std::pair& pair: this->prefix_to_mode) + for (const auto& pair: this->prefix_to_mode) if (pair.second == c) { type = 1; diff --git a/src/network/credentials_manager.cpp b/src/network/credentials_manager.cpp index 0908a2f93b97d8c7e91293a2dd46d7f5f22b2b29..ea7662714408f3296e6baf8d6a8c54a6bde00411 100644 --- a/src/network/credentials_manager.cpp +++ b/src/network/credentials_manager.cpp @@ -44,7 +44,7 @@ const std::string& BasicCredentialsManager::get_trusted_fingerprint() const void check_tls_certificate(const std::vector& certs, const std::string& hostname, const std::string& trusted_fingerprint, - std::exception_ptr exc) + const std::exception_ptr& exc) { if (!trusted_fingerprint.empty() && !certs.empty() && diff --git a/src/network/credentials_manager.hpp b/src/network/credentials_manager.hpp index c463ad498dbaecb7c74aec5c7a83a5ab4aa7b3f8..e7c247d852bb34708ff2c4b68117665fc23d1602 100644 --- a/src/network/credentials_manager.hpp +++ b/src/network/credentials_manager.hpp @@ -19,7 +19,7 @@ class TCPSocketHandler; */ void check_tls_certificate(const std::vector& certs, const std::string& hostname, const std::string& trusted_fingerprint, - std::exception_ptr exc); + const std::exception_ptr& exc); class BasicCredentialsManager: public Botan::Credentials_Manager { diff --git a/src/xmpp/xmpp_component.cpp b/src/xmpp/xmpp_component.cpp index 8335c8ac6cd7dd18eebf4f72b4ab11404a1f528a..35abbee02f55a597bb2fb8b525a9ba0565b89afe 100644 --- a/src/xmpp/xmpp_component.cpp +++ b/src/xmpp/xmpp_component.cpp @@ -445,7 +445,7 @@ void XmppComponent::send_muc_leave(const std::string& muc_name, const std::strin presence["to"] = jid_to; presence["from"] = muc_name + "@" + this->served_hostname + "/" + nick; presence["type"] = "unavailable"; - const std::string message_str = std::get<0>(message); + const std::string& message_str = std::get<0>(message); XmlSubNode x(presence, "x"); x["xmlns"] = MUC_USER_NS; if (self) diff --git a/src/xmpp/xmpp_stanza.cpp b/src/xmpp/xmpp_stanza.cpp index 499985106db122ee1060fd6bea9b7b9ac8ccb7dd..435f33313b0931acc449ca434f369e308e6b7a9f 100644 --- a/src/xmpp/xmpp_stanza.cpp +++ b/src/xmpp/xmpp_stanza.cpp @@ -52,7 +52,7 @@ XmlNode::XmlNode(const std::string& name, XmlNode* parent): parent(parent) { // split the namespace and the name - auto n = name.rfind(":"); + auto n = name.rfind(':'); if (n == std::string::npos) this->name = name; else