14 #include "privatexml.h"
15 #include "clientbase.h"
22 PrivateXML::Query::Query(
const Tag* tag )
28 if( tag->name() ==
"query" && tag->xmlns() == XMLNS_PRIVATE_XML )
30 if( tag->children().size() )
31 m_privateXML = tag->children().front()->clone();
37 const std::string& PrivateXML::Query::filterString()
const
39 static const std::string filter =
"/iq/query[@xmlns='" +
XMLNS_PRIVATE_XML +
"']";
43 Tag* PrivateXML::Query::tag()
const
45 Tag* t =
new Tag(
"query" );
46 t->setXmlns( XMLNS_PRIVATE_XML );
48 t->addChild( m_privateXML->clone() );
77 const std::string&
id = m_parent->
getID();
83 m_parent->
send( iq,
this, RequestXml );
90 const std::string&
id = m_parent->
getID();
96 m_parent->
send( iq,
this, StoreXml );
103 TrackMap::iterator t = m_track.find( iq.
id() );
104 if( t == m_track.end() )
109 if( context == RequestXml )
113 (*t).second->handlePrivateXML( q->privateXML() );
115 else if( context == StoreXml )
120 if( context == RequestXml )
122 else if( context == StoreXml )
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
const std::string getID()
void removeIqHandler(IqHandler *ih, int exttype)
void removeIDHandler(IqHandler *ih)
bool removeStanzaExtension(int ext)
void registerIqHandler(IqHandler *ih, int exttype)
void registerStanzaExtension(StanzaExtension *ext)
An abstraction of an IQ stanza.
A virtual interface which can be reimplemented to store and receive private XML data.
std::string requestXML(const std::string &tag, const std::string &xmlns, PrivateXMLHandler *pxh)
virtual void handleIqID(const IQ &iq, int context)
std::string storeXML(const Tag *tag, PrivateXMLHandler *pxh)
void addExtension(const StanzaExtension *se)
const std::string & id() const
const StanzaExtension * findExtension(int type) const
This is an abstraction of an XML element.
The namespace for the gloox library.
const std::string XMLNS_PRIVATE_XML