diff options
author | louiz’ <louiz@louiz.org> | 2022-03-10 23:23:47 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2022-03-10 23:23:47 +0100 |
commit | 0061298dd0945f7f67e7fa340c6649b179c804d5 (patch) | |
tree | 23f178ae4f3d988c0c712c79e3d7156fcc5a33e0 /src/xmpp/xmpp_stanza.cpp | |
parent | 18b6006e30c26a2fb6196e3b16420de74a654a73 (diff) | |
download | biboumi-0061298dd0945f7f67e7fa340c6649b179c804d5.tar.gz biboumi-0061298dd0945f7f67e7fa340c6649b179c804d5.tar.bz2 biboumi-0061298dd0945f7f67e7fa340c6649b179c804d5.tar.xz biboumi-0061298dd0945f7f67e7fa340c6649b179c804d5.zip |
Instead use \1, and build our own nodes by explicitely separating the
namespace and the node name.
Diffstat (limited to 'src/xmpp/xmpp_stanza.cpp')
-rw-r--r-- | src/xmpp/xmpp_stanza.cpp | 14 |
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(); |