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.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/xmpp/xmpp_stanza.cpp b/src/xmpp/xmpp_stanza.cpp
index 435f333..0103dd7 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('\1');
if (n == std::string::npos)
this->name = name;
else
@@ -67,6 +67,18 @@ XmlNode::XmlNode(const std::string& name):
{
}
+XmlNode::XmlNode(const std::string& xmlns, const std::string& name, XmlNode* parent):
+ name(name),
+ parent(parent)
+{
+ this->attributes["xmlns"] = xmlns;
+}
+
+XmlNode::XmlNode(const std::string& xmlns, const std::string& name):
+ XmlNode(xmlns, name, nullptr)
+{
+}
+
void XmlNode::delete_all_children()
{
this->children.clear();