Index: source/QXmppStream.cpp =================================================================== --- source/QXmppStream.cpp (revision 177) +++ source/QXmppStream.cpp (working copy) @@ -292,8 +292,12 @@ QString ns = nodeRecv.namespaceURI(); log("Namespace: " + ns + " Tag: " + nodeRecv.tagName() ); - if(ns == ns_stream && nodeRecv.tagName() == "features") + if(m_client->handleStreamElement(nodeRecv)) { + // already handled by client, do nothing + } + else if(ns == ns_stream && nodeRecv.tagName() == "features") + { bool nonSaslAvailable = nodeRecv.firstChildElement("auth"). namespaceURI() == ns_authFeature; bool saslAvailable = nodeRecv.firstChildElement("mechanisms"). Index: source/QXmppClient.cpp =================================================================== --- source/QXmppClient.cpp (revision 177) +++ source/QXmppClient.cpp (working copy) @@ -504,3 +504,17 @@ { return m_stream->getTransferManager(); } + +/// Reimplement n your subclass of QXmppClient if you want to handle +/// raw XML elements yourself. +/// +/// WARNING: you can seriously disrupt packet handling when doing this, +/// so use with care and at your own risk. +/// +/// Return true if you handled the element yourself, or false if +/// you want to use the default handling for the element. + +bool QXmppClient::handleStreamElement(const QDomElement &element) +{ + return false; +} Index: source/QXmppClient.h =================================================================== --- source/QXmppClient.h (revision 177) +++ source/QXmppClient.h (working copy) @@ -194,6 +194,8 @@ QXmppClient::StreamError getXmppStreamError(); + virtual bool handleStreamElement(const QDomElement &element); + public slots: void sendPacket(const QXmppPacket&); void sendMessage(const QString& bareJid, const QString& message);