]> code.delx.au - pymsnt/blobdiff - src/main.py
Merged branches/msnfix 204:217 to trunk
[pymsnt] / src / main.py
index eb90dd4e467c6951346c9ab3a3697f9cb7a393b4..305d549b18f254210134ce7d477a17ea743237e6 100644 (file)
@@ -6,6 +6,7 @@ reload(sys)
 sys.setdefaultencoding("utf-8")
 sys.stdout = codecs.lookup('utf-8')[-1](sys.stdout)
 
+
 # Find the best reactor
 selectWarning = "Unable to install any good reactors (kqueue, epoll, poll).\nWe fell back to using select. You may have scalability problems.\nThis reactor will not support more than 1024 connections at a time."
 try:
@@ -29,6 +30,8 @@ except:
                                        sys.exit(1)
 bestreactor.install()
 
+import twistfix
+twistfix.main()
 
 
 # Must load config before everything else
@@ -92,7 +95,10 @@ if config.reactor:
 
 from twisted.internet import reactor, task
 from twisted.internet.defer import Deferred
-from tlib.xmlw import Element, jid, component
+from twisted.words.xish.domish import Element
+from twisted.words.protocols.jabber import component
+from twisted.words.protocols.jabber.jid import internJID
+
 from debug import LogEvent, INFO, WARN, ERROR
 
 import debug
@@ -240,7 +246,7 @@ class PyTransport(component.Service):
        def onMessage(self, el):
                fro = el.getAttribute("from")
                try:
-                       froj = jid.intern(fro)
+                       froj = internJID(fro)
                except Exception, e:
                        LogEvent(WARN, "", "Failed stringprep.")
                        return
@@ -266,8 +272,8 @@ class PyTransport(component.Service):
                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, "", "Failed stringprep.")
                        return