summaryrefslogtreecommitdiff
path: root/louloulibs/xmpp/xmpp_component.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 /louloulibs/xmpp/xmpp_component.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 'louloulibs/xmpp/xmpp_component.cpp')
-rw-r--r--louloulibs/xmpp/xmpp_component.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/louloulibs/xmpp/xmpp_component.cpp b/louloulibs/xmpp/xmpp_component.cpp
index 19111ba..8cd722d 100644
--- a/louloulibs/xmpp/xmpp_component.cpp
+++ b/louloulibs/xmpp/xmpp_component.cpp
@@ -256,7 +256,7 @@ void XmppComponent::handle_handshake(const Stanza& stanza)
void XmppComponent::handle_error(const Stanza& stanza)
{
- XmlNode* text = stanza.get_child("text", STREAMS_NS);
+ const XmlNode* text = stanza.get_child("text", STREAMS_NS);
std::string error_message("Unspecified error");
if (text)
error_message = text->get_inner();
@@ -291,7 +291,7 @@ void XmppComponent::send_message(const std::string& from, Xmpp::body&& body, con
XmlNode html("html");
html["xmlns"] = XHTMLIM_NS;
// Pass the ownership of the pointer to this xmlnode
- html.add_child(std::get<1>(body).release());
+ html.add_child(std::move(std::get<1>(body)));
node.add_child(std::move(html));
}
this->send_stanza(node);
@@ -420,7 +420,7 @@ void XmppComponent::send_muc_message(const std::string& muc_name, const std::str
XmlNode html("html");
html["xmlns"] = XHTMLIM_NS;
// Pass the ownership of the pointer to this xmlnode
- html.add_child(std::get<1>(xmpp_body).release());
+ html.add_child(std::move(std::get<1>(xmpp_body)));
message.add_child(std::move(html));
}
this->send_stanza(message);