Index: src/common/xmpp/protocol.py
===================================================================
--- src/common/xmpp/protocol.py	(revision 2767)
+++ src/common/xmpp/protocol.py	(working copy)
@@ -70,8 +70,9 @@
 NS_FILE         ='http://jabber.org/protocol/si/profile/file-transfer' # JEP-0096
 NS_FEATURE      ='http://jabber.org/protocol/feature-neg'
 NS_BYTESTREAM   ='http://jabber.org/protocol/bytestreams' # JEP-0065
-NS_DISCO		='http://jabber.org/protocol/disco#info' # JEP-0095
-NS_STREAM		='http://affinix.com/jabber/stream'
+NS_DISCO        ='http://jabber.org/protocol/disco#info' # JEP-0095
+NS_STREAM       ='http://affinix.com/jabber/stream'
+NS_HTTP_AUTH    ='http://jabber.org/protocol/http-auth'         # JEP-0070
 
 xmpp_stream_error_conditions="""
 bad-format --  --  -- The entity has sent XML that cannot be processed.
@@ -324,10 +325,10 @@
                 if tag.getName()<>'text': return tag.getName()
             return errtag.getData()
     def getErrorCode(self):
-        """ Return the error code. Obsolette. """
+        """ Return the error code. Obsolete. """
         return self.getTagAttr('error','code')
     def setError(self,error,code=None):
-        """ Set the error code. Obsolette. Use error-conditions instead. """
+        """ Set the error code. Obsolete. Use error-conditions instead. """
         if code:
             if str(code) in _errorcodes.keys(): error=ErrorNode(_errorcodes[str(code)],text=error)
             else: error=ErrorNode(ERR_UNDEFINED_CONDITION,code=code,typ='cancel',text=error)
@@ -449,42 +450,53 @@
 
 class Iq(Protocol): 
     """ XMPP Iq object - get/set dialog mechanism. """
-    def __init__(self, typ=None, queryNS=None, attrs={}, to=None, frm=None, payload=[], xmlns=NS_CLIENT, node=None):
+    def __init__(self, typ=None, queryNS=None, attrs={}, to=None, frm=None,
+                 payload=[], xmlns=NS_CLIENT, node=None, iq_child='query'):
         """ Create Iq object. You can specify type, query namespace
-            any additional attributes, recipient of the iq, sender of the iq, any additional payload (f.e. jabber:x:data node) and namespace in one go.
-            Alternatively you can pass in the other XML object as the 'node' parameted to replicate it as an iq. """
-        Protocol.__init__(self, 'iq', to=to, typ=typ, attrs=attrs, frm=frm, xmlns=xmlns, node=node)
+            any additional attributes, recipient of the iq, sender of the iq,
+            any additional payload (f.e. jabber:x:data node) and namespace in
+            one go.  Alternatively you can pass in the other XML object as the
+            'node' parameted to replicate it as an iq.  Many protocols
+            have an inner child named 'query' for the Iq payload, but this is
+            not required. To allow for newer protocols the name of this child
+            can be specified to override the default value 'query'."""
+        Protocol.__init__(self, 'iq', to=to, typ=typ, attrs=attrs, frm=frm,
+                          xmlns=xmlns, node=node)
+        self.iq_child = iq_child or 'query'
         if payload: self.setQueryPayload(payload)
         if queryNS: self.setQueryNS(queryNS)
+    def setIqChildName(self, iq_child):
+        self.iq_child = iq_child or 'query';
     def getQueryNS(self):
-        """ Return the namespace of the 'query' child element."""
-        tag=self.getTag('query')
+        """ Return the namespace of the iq child element."""
+        tag=self.getTag(self.iq_child)
         if tag: return tag.getNamespace()
     def getQuerynode(self):
-        """ Return the 'node' attribute value of the 'query' child element."""
-        return self.getTagAttr('query','node')
+        """ Return the 'node' attribute value of the iq child element."""
+        return self.getTagAttr(self.iq_child,'node')
     def getQueryPayload(self):
-        """ Return the 'query' child element payload."""
-        tag=self.getTag('query')
+        """ Return the iq child element payload."""
+        tag=self.getTag(self.iq_child)
         if tag: return tag.getPayload()
     def getQueryChildren(self):
-        """ Return the 'query' child element child nodes."""
-        tag=self.getTag('query')
+        """ Return the iq child element child nodes."""
+        tag=self.getTag(self.iq_child)
         if tag: return tag.getChildren()
     def setQueryNS(self,namespace):
-        """ Set the namespace of the 'query' child element."""
-        self.setTag('query').setNamespace(namespace)
+        """ Set the namespace of the iq child element."""
+        self.setTag(self.iq_child).setNamespace(namespace)
     def setQueryPayload(self,payload):
-        """ Set the 'query' child element payload."""
-        self.setTag('query').setPayload(payload)
+        """ Set the iq child element payload."""
+        self.setTag(self.iq_child).setPayload(payload)
     def setQuerynode(self,node):
-        """ Set the 'node' attribute value of the 'query' child element."""
-        self.setTagAttr('query','node',node)
+        """ Set the 'node' attribute value of the iq child element."""
+        self.setTagAttr(self.iq_child,'node',node)
     def buildReply(self,typ):
         """ Builds and returns another Iq object of specified type.
-            The to, from and query child node of new Iq are pre-set as reply to this Iq. """
+            The to, from and child node of new Iq are pre-set as reply
+            to this Iq. """
         iq=Iq(typ,to=self.getFrom(),frm=self.getTo(),attrs={'id':self.getID()})
-        if self.getTag('query'): iq.setQueryNS(self.getQueryNS())
+        if self.getTag(self.iq_child): iq.setQueryNS(self.getQueryNS())
         return iq
 
 class ErrorNode(Node):
