summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/adhoc_command.cpp5
-rw-r--r--src/xmpp/adhoc_command.hpp2
-rw-r--r--src/xmpp/biboumi_component.cpp10
-rw-r--r--src/xmpp/jid.cpp2
-rw-r--r--src/xmpp/xmpp_stanza.cpp2
5 files changed, 10 insertions, 11 deletions
diff --git a/src/xmpp/adhoc_command.cpp b/src/xmpp/adhoc_command.cpp
index 825cc92..e02bf35 100644
--- a/src/xmpp/adhoc_command.cpp
+++ b/src/xmpp/adhoc_command.cpp
@@ -1,11 +1,12 @@
+#include <utility>
#include <xmpp/adhoc_command.hpp>
#include <xmpp/xmpp_component.hpp>
#include <utils/reload.hpp>
using namespace std::string_literals;
-AdhocCommand::AdhocCommand(std::vector<AdhocStep>&& callbacks, const std::string& name, const bool admin_only):
- name(name),
+AdhocCommand::AdhocCommand(std::vector<AdhocStep>&& callbacks, std::string name, const bool admin_only):
+ name(std::move(name)),
callbacks(std::move(callbacks)),
admin_only(admin_only)
{
diff --git a/src/xmpp/adhoc_command.hpp b/src/xmpp/adhoc_command.hpp
index ced4549..c00d9e6 100644
--- a/src/xmpp/adhoc_command.hpp
+++ b/src/xmpp/adhoc_command.hpp
@@ -17,7 +17,7 @@ class AdhocCommand
{
friend class AdhocSession;
public:
- AdhocCommand(std::vector<AdhocStep>&& callbacks, const std::string& name, const bool admin_only);
+ AdhocCommand(std::vector<AdhocStep>&& callbacks, std::string name, const bool admin_only);
~AdhocCommand() = default;
AdhocCommand(const AdhocCommand&) = default;
AdhocCommand(AdhocCommand&&) = default;
diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp
index dc57eeb..b4b6a45 100644
--- a/src/xmpp/biboumi_component.cpp
+++ b/src/xmpp/biboumi_component.cpp
@@ -83,10 +83,8 @@ BiboumiComponent::BiboumiComponent(std::shared_ptr<Poller>& poller, const std::s
void BiboumiComponent::shutdown()
{
- for (auto it = this->bridges.begin(); it != this->bridges.end(); ++it)
- {
- it->second->shutdown("Gateway shutdown");
- }
+ for (auto& pair: this->bridges)
+ pair.second->shutdown("Gateway shutdown");
}
void BiboumiComponent::clean()
@@ -696,8 +694,8 @@ Bridge* BiboumiComponent::find_user_bridge(const std::string& full_jid)
std::vector<Bridge*> BiboumiComponent::get_bridges() const
{
std::vector<Bridge*> res;
- for (auto it = this->bridges.begin(); it != this->bridges.end(); ++it)
- res.push_back(it->second.get());
+ for (const auto& bridge: this->bridges)
+ res.push_back(bridge.second.get());
return res;
}
diff --git a/src/xmpp/jid.cpp b/src/xmpp/jid.cpp
index ba8d70b..19d1b55 100644
--- a/src/xmpp/jid.cpp
+++ b/src/xmpp/jid.cpp
@@ -53,7 +53,7 @@ std::string jidprep(const std::string& original)
char local[max_jid_part_len] = {};
memcpy(local, jid.local.data(), std::min(max_jid_part_len, jid.local.size()));
- Stringprep_rc rc = static_cast<Stringprep_rc>(::stringprep(local, max_jid_part_len,
+ auto rc = static_cast<Stringprep_rc>(::stringprep(local, max_jid_part_len,
static_cast<Stringprep_profile_flags>(0), stringprep_xmpp_nodeprep));
if (rc != STRINGPREP_OK)
{
diff --git a/src/xmpp/xmpp_stanza.cpp b/src/xmpp/xmpp_stanza.cpp
index ac6ce9b..4999851 100644
--- a/src/xmpp/xmpp_stanza.cpp
+++ b/src/xmpp/xmpp_stanza.cpp
@@ -7,7 +7,7 @@
#include <iostream>
#include <sstream>
-#include <string.h>
+#include <cstring>
std::string xml_escape(const std::string& data)
{