summaryrefslogtreecommitdiff
path: root/src/xmpp/xmpp_stanza.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-15 00:27:58 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-15 00:32:31 +0200
commitbafde1af9f284d8d1daf001d59f4b338e5d2f922 (patch)
treedab69146d27422c73754c2e929fa4a96cfa902f1 /src/xmpp/xmpp_stanza.cpp
parent12c8b1ae0b6f4c2b80d7c787b892ebcaafae6b03 (diff)
downloadbiboumi-bafde1af9f284d8d1daf001d59f4b338e5d2f922.tar.gz
biboumi-bafde1af9f284d8d1daf001d59f4b338e5d2f922.tar.bz2
biboumi-bafde1af9f284d8d1daf001d59f4b338e5d2f922.tar.xz
biboumi-bafde1af9f284d8d1daf001d59f4b338e5d2f922.zip
Stanza:get_name() only returns the name of the tag, without the namespace
Diffstat (limited to 'src/xmpp/xmpp_stanza.cpp')
-rw-r--r--src/xmpp/xmpp_stanza.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/xmpp/xmpp_stanza.cpp b/src/xmpp/xmpp_stanza.cpp
index 948e5f5..400971b 100644
--- a/src/xmpp/xmpp_stanza.cpp
+++ b/src/xmpp/xmpp_stanza.cpp
@@ -1,6 +1,7 @@
#include <xmpp/xmpp_stanza.hpp>
#include <utils/encoding.hpp>
+#include <utils/split.hpp>
#include <stdexcept>
#include <iostream>
@@ -183,9 +184,13 @@ XmlNode* XmlNode::get_parent() const
return this->parent;
}
-const std::string& XmlNode::get_name() const
+const std::string XmlNode::get_name() const
{
- return this->name;
+ const std::vector<std::string> splited = utils::split(this->name, ':', false);
+ if (splited.empty())
+ return "";
+ const std::string res = splited.back();
+ return res;
}
std::string XmlNode::to_string() const