summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_stanza.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/xmpp/xmpp_stanza.cpp')
-rw-r--r--src/xmpp/xmpp_stanza.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/xmpp/xmpp_stanza.cpp b/src/xmpp/xmpp_stanza.cpp
index 348d73c..85bd6b5 100644
--- a/src/xmpp/xmpp_stanza.cpp
+++ b/src/xmpp/xmpp_stanza.cpp
@@ -152,15 +152,17 @@ XmlNode* XmlNode::get_child(const std::string& name) const
return nullptr;
}
-void XmlNode::add_child(XmlNode* child)
+XmlNode* XmlNode::add_child(XmlNode* child)
{
+ child->parent = this;
this->children.push_back(child);
+ return child;
}
-void XmlNode::add_child(XmlNode&& child)
+XmlNode* XmlNode::add_child(XmlNode&& child)
{
XmlNode* new_node = new XmlNode(std::move(child));
- this->add_child(new_node);
+ return this->add_child(new_node);
}
XmlNode* XmlNode::get_last_child() const