From bafde1af9f284d8d1daf001d59f4b338e5d2f922 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 15 May 2014 00:27:58 +0200 Subject: Stanza:get_name() only returns the name of the tag, without the namespace --- src/xmpp/xmpp_stanza.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/xmpp/xmpp_stanza.cpp') 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 #include +#include #include #include @@ -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 splited = utils::split(this->name, ':', false); + if (splited.empty()) + return ""; + const std::string res = splited.back(); + return res; } std::string XmlNode::to_string() const -- cgit v1.2.3