summaryrefslogtreecommitdiff
path: root/src/xmpp/biboumi_adhoc_commands.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-09-01 14:47:57 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-09-01 14:47:57 +0200
commitf3b3d937ae274d0eec4a737d11ba19a7f4ceef03 (patch)
treec8dbd17073d8247c1d292050c1fff2f12c2114b1 /src/xmpp/biboumi_adhoc_commands.cpp
parent38564d77c7679dd4de4562d321146322b6211d61 (diff)
downloadbiboumi-f3b3d937ae274d0eec4a737d11ba19a7f4ceef03.tar.gz
biboumi-f3b3d937ae274d0eec4a737d11ba19a7f4ceef03.tar.bz2
biboumi-f3b3d937ae274d0eec4a737d11ba19a7f4ceef03.tar.xz
biboumi-f3b3d937ae274d0eec4a737d11ba19a7f4ceef03.zip
Use unique_ptr to store the XmlNode’s children
Also fix some constness things
Diffstat (limited to 'src/xmpp/biboumi_adhoc_commands.cpp')
-rw-r--r--src/xmpp/biboumi_adhoc_commands.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp
index 0dcaf0c..3dbee81 100644
--- a/src/xmpp/biboumi_adhoc_commands.cpp
+++ b/src/xmpp/biboumi_adhoc_commands.cpp
@@ -48,26 +48,26 @@ void DisconnectUserStep2(XmppComponent* xmpp_component, AdhocSession& session, X
// Find out if the jids, and the quit message are provided in the form.
std::string quit_message;
- XmlNode* x = command_node.get_child("x", "jabber:x:data");
+ const XmlNode* x = command_node.get_child("x", "jabber:x:data");
if (x)
{
- XmlNode* message_field = nullptr;
- XmlNode* jids_field = nullptr;
- for (XmlNode* field: x->get_children("field", "jabber:x:data"))
+ const XmlNode* message_field = nullptr;
+ const XmlNode* jids_field = nullptr;
+ for (const XmlNode* field: x->get_children("field", "jabber:x:data"))
if (field->get_tag("var") == "jids")
jids_field = field;
else if (field->get_tag("var") == "quit-message")
message_field = field;
if (message_field)
{
- XmlNode* value = message_field->get_child("value", "jabber:x:data");
+ const XmlNode* value = message_field->get_child("value", "jabber:x:data");
if (value)
quit_message = value->get_inner();
}
if (jids_field)
{
std::size_t num = 0;
- for (XmlNode* value: jids_field->get_children("value", "jabber:x:data"))
+ for (const XmlNode* value: jids_field->get_children("value", "jabber:x:data"))
{
Bridge* bridge = biboumi_component->find_user_bridge(value->get_inner());
if (bridge)