# Copyright 2004-2005 James Bunton <james@delx.cjb.net>
# Licensed for distribution under the GPL version 2, check COPYING for details
-import utils
-from tlib.xmlw import Element, jid
+from debug import LogEvent, INFO, WARN, ERROR
+
from twisted.internet.defer import Deferred
from twisted.internet import reactor
-from debug import LogEvent, INFO, WARN, ERROR
+from tlib.xmlw import Element, jid
+
import sys
-import config
-import legacy
+
import lang
+import utils
+import config
XMPP_STANZAS = "urn:ietf:params:xml:ns:xmpp-stanzas"
DISCO = "http://jabber.org/protocol/disco"
DISCO_INFO = DISCO + "#info"
COMMANDS = "http://jabber.org/protocol/commands"
CAPS = "http://jabber.org/protocol/caps"
-SUBSYNC = "http://jabber.org/protocol/roster-subsync"
+SUBSYNC = "http://delx.cjb.net/protocol/roster-subsync"
MUC = "http://jabber.org/protocol/muc"
MUC_USER = MUC + "#user"
FEATURE_NEG = "http://jabber.org/protocol/feature-neg"
Returns a deferred which will fire with the matching IQ response as it's sole argument. """
def checkDeferred():
if(not d.called):
- d.errback()
+ d.errback(Exception("Timeout"))
del self.deferredIqs[(jid, ID)]
jid = el.getAttribute("to")
try: # Stringprep
froj = jid.intern(fro)
to = jid.intern(to).full()
- except Exception, e:
+ except Exception:
LogEvent(WARN, "", "Dropping IQ because of stringprep error")
# Check if it's a response to a send IQ
LogEvent(INFO, "", "Looking for handler")
for query in el.elements():
- xmlns = query.defaultUri
+ xmlns = query.uri
node = query.getAttribute("node")
if xmlns.startswith(DISCO) and node:
error.attributes["type"] = etype
error.attributes["code"] = str(utils.errorCodeMap[condition])
cond = error.addElement(condition)
+ cond.attributes["xmlns"] = XMPP_STANZAS
self.pytrans.send(el)