]> code.delx.au - pymsnt/blobdiff - src/misciq.py
Trunk is broken. Don't use!
[pymsnt] / src / misciq.py
index 56b5be6158f24b33477f65b97ffbdb723ea2dcb1..c2b180b5101de58ea6864ef1146b6b530ef7b68a 100644 (file)
@@ -2,12 +2,6 @@
 # Licensed for distribution under the GPL version 2, check COPYING for details
 
 import utils
-if(utils.checkTwisted()):
-       from twisted.xish.domish import Element
-       from twisted.words.protocols.jabber import jid
-else:
-       from tlib.domish import Element
-       from tlib.jabber import jid
 from twisted.internet import reactor, task
 from debug import LogEvent, INFO, WARN, ERROR
 import jabw
@@ -33,7 +27,7 @@ class ConnectUsers:
                ID = el.getAttribute("id")
                ulang = utils.getLang(el)
 
-               if config.admins.count(jid.JID(to).userhost()) == 0:
+               if config.admins.count(utils.jid(to).userhost()) == 0:
                        self.pytrans.discovery.sendIqError(to=to, fro=config.jid, ID=ID, xmlns=disco.COMMANDS, etype="cancel", condition="not-authorized")
                        return
 
@@ -134,7 +128,7 @@ class AdHocCommands:
        def incomingIq(self, el):
                itype = el.getAttribute("type")
                fro = el.getAttribute("from")
-               froj = jid.JID(fro)
+               froj = utils.jid(fro)
                to = el.getAttribute("to")
                ID = el.getAttribute("id")
 
@@ -222,7 +216,7 @@ class VCardFactory:
        def incomingIq(self, el):
                itype = el.getAttribute("type")
                fro = el.getAttribute("from")
-               froj = jid.JID(fro)
+               froj = utils.jid(fro)
                to = el.getAttribute("to")
                ID = el.getAttribute("id")
                if(itype != "get" and itype != "error"):
@@ -282,7 +276,7 @@ class IqAvatarFactory:
        def incomingIq(self, el):
                itype = el.getAttribute("type")
                fro = el.getAttribute("from")
-               froj = jid.JID(fro)
+               froj = utils.jid(fro)
                to = el.getAttribute("to")
                ID = el.getAttribute("id")