]> code.delx.au - pymsnt/blobdiff - src/misciq.py
Merged branches/msnfix 204:217 to trunk
[pymsnt] / src / misciq.py
index dc6baade6d9319102319a1afbd85211a93d63743..eb27bd78e36e23e4189b426b7b13c4fd0c722cf1 100644 (file)
@@ -3,7 +3,8 @@
 
 import utils
 from twisted.internet import reactor, task, protocol, error
-from tlib.xmlw import Element, jid
+from twisted.words.xish.domish import Element
+from twisted.words.protocols.jabber.jid import internJID
 from debug import LogEvent, INFO, WARN, ERROR
 import svninfo
 import jabw
@@ -30,7 +31,7 @@ class ConnectUsers:
                ID = el.getAttribute("id")
                ulang = utils.getLang(el)
 
-               if config.admins.count(jid.intern(to).userhost()) == 0:
+               if config.admins.count(internJID(to).userhost()) == 0:
                        self.pytrans.discovery.sendIqError(to=to, fro=config.jid, ID=ID, xmlns=disco.COMMANDS, etype="cancel", condition="not-authorized")
                        return
 
@@ -131,7 +132,7 @@ class AdHocCommands:
        def incomingIq(self, el):
                itype = el.getAttribute("type")
                fro = el.getAttribute("from")
-               froj = jid.intern(fro)
+               froj = internJID(fro)
                to = el.getAttribute("to")
                ID = el.getAttribute("id")
 
@@ -219,9 +220,9 @@ class VCardFactory:
        def incomingIq(self, el):
                itype = el.getAttribute("type")
                fro = el.getAttribute("from")
-               froj = jid.intern(fro)
+               froj = internJID(fro)
                to = el.getAttribute("to")
-               toj = jid.intern(to)
+               toj = internJID(to)
                ID = el.getAttribute("id")
                if itype != "get" and itype != "error":
                        self.pytrans.discovery.sendIqError(to=fro, fro=config.jid, ID=ID, xmlns="vcard-temp", etype="cancel", condition="feature-not-implemented")
@@ -280,9 +281,9 @@ class IqAvatarFactory:
        def incomingIq(self, el):
                itype = el.getAttribute("type")
                fro = el.getAttribute("from")
-               froj = jid.intern(fro)
+               froj = internJID(fro)
                to = el.getAttribute("to")
-               toj = jid.intern(to)
+               toj = internJID(to)
                ID = el.getAttribute("id")
 
                if(itype != "get" and itype != "error"):
@@ -489,8 +490,8 @@ class FileTransferOOBSend:
                else:
                        return errOut()
 
-               froj = jid.intern(el.getAttribute("from"))
-               toj = jid.intern(el.getAttribute("to"))
+               froj = internJID(el.getAttribute("from"))
+               toj = internJID(el.getAttribute("to"))
                session = self.pytrans.sessions.get(froj.userhost(), None)
                if not session:
                        return errOut()
@@ -548,8 +549,8 @@ class Socks5FileTransfer:
                def errOut():
                        self.pytrans.discovery.sendIqError(to=el.getAttribute("from"), fro=el.getAttribute("to"), ID=ID, xmlns=disco.SI, etype="cancel", condition="bad-request")
 
-               toj = jid.intern(el.getAttribute("to"))
-               froj = jid.intern(el.getAttribute("from"))
+               toj = internJID(el.getAttribute("to"))
+               froj = internJID(el.getAttribute("from"))
                session = self.pytrans.sessions.get(froj.userhost(), None)
                if not session:
                        return errOut()
@@ -620,8 +621,8 @@ class Socks5FileTransfer:
                if el.getAttribute("type") != "set":
                        return errOut()
 
-               toj = jid.intern(el.getAttribute("to"))
-               froj = jid.intern(el.getAttribute("from"))
+               toj = internJID(el.getAttribute("to"))
+               froj = internJID(el.getAttribute("from"))
 
                query = el.query
                if not (query and query.getAttribute("mode", "tcp") == "tcp"):