]> code.delx.au - pymsnt/blobdiff - src/jabw.py
Merged branches/msnfix 204:217 to trunk
[pymsnt] / src / jabw.py
index e6f2897302744288a6dd37df0396c0fc149cb954..aa9ddffb289f1ef07cabf2ed6d21aaaf7c5adcd8 100644 (file)
@@ -2,7 +2,8 @@
 # Licensed for distribution under the GPL version 2, check COPYING for details
 
 import utils
-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 disco
 
@@ -34,8 +35,8 @@ def sendPresence(pytrans, to, fro, show=None, status=None, priority=None, ptype=
        # Strip the resource off any presence subscribes (as per XMPP RFC 3921 Section 5.1.6)
        # Makes eJabberd behave :)
        if ptype in ("subscribe", "subscribed", "unsubscribe", "unsubscribed"):
-               to = jid.intern(to).userhost()
-               fro = jid.intern(fro).userhost()
+               to = internJID(to).userhost()
+               fro = internJID(fro).userhost()
        
        el = Element((None, "presence"))
        el.attributes["to"] = to
@@ -183,8 +184,8 @@ class JabberConnection:
                fro = el.getAttribute("from")
                to = el.getAttribute("to")
                try:
-                       froj = jid.intern(fro)
-                       toj = jid.intern(to)
+                       froj = internJID(fro)
+                       toj = internJID(to)
                except Exception, e:
                        LogEvent(WARN, self.jabberID)
                        return
@@ -245,9 +246,9 @@ class JabberConnection:
                """ Handles incoming presence packets """
                #LogEvent(INFO, self.jabberID)
                fro = el.getAttribute("from")
-               froj = jid.intern(fro)
+               froj = internJID(fro)
                to = el.getAttribute("to")
-               toj = jid.intern(to)
+               toj = internJID(to)
                
                # Grab the contents of the <presence/> packet
                ptype = el.getAttribute("type")