21 static const char* errValues [] = {
30 static const char* stanzaErrValues [] = {
33 "feature-not-implemented",
36 "internal-server-error",
44 "recipient-unavailable",
46 "registration-required",
47 "remote-server-not-found",
48 "remote-server-timeout",
49 "resource-constraint",
50 "service-unavailable",
51 "subscription-required",
52 "undefined-condition",
57 static inline StanzaErrorType stanzaErrorType(
const std::string& type )
62 static inline StanzaError stanzaError(
const std::string& type )
64 return (
StanzaError)util::lookup( type, stanzaErrValues );
71 if( !tag || tag->
name() !=
"error" )
76 TagList::const_iterator it = tag->
children().begin();
77 for( ; it != tag->
children().end(); ++it )
79 StanzaError srt = gloox::stanzaError( (*it)->name() );
82 else if( (*it)->name() ==
"text" )
83 m_text[(*it)->findAttribute(
"xml:lang")] = (*it)->cdata();
85 m_appError = (*it)->
clone();
91 m_error( error.m_error ), m_appError( error.m_appError ? m_appError->clone() : 0 )
101 static const std::string filter =
"/iq/error"
104 "|/subscription/error";
114 Tag*
error =
new Tag(
"error",
TYPE, util::lookup( m_type, errValues ) );
117 StringMap::const_iterator it = m_text.begin();
118 for( ; it != m_text.end(); ++it )
120 Tag* txt =
new Tag( error,
"text" );
134 StringMap::const_iterator it = m_text.find( lang );
135 return it != m_text.end() ? (*it).second :
EmptyString;