]> code.delx.au - pymsnt/blobdiff - src/legacy/glue.py
Fixed reconnecting problem (finally)
[pymsnt] / src / legacy / glue.py
index c72cb7417bf87d85250293a4d023a0b42702cabc..19ab707471efa3202d0b1db4ab3abeae9d58ab5a 100644 (file)
@@ -3,7 +3,7 @@
 
 import os.path
 import utils
-from twisted.internet import task
+from twisted.internet import task, error
 from tlib.xmlw import Element
 from tlib import msn
 from debug import LogEvent, INFO, WARN, ERROR
@@ -378,8 +378,9 @@ class LegacyConnection(msn.MSNConnection):
        
        def connectionLost(self, reason):
                LogEvent(INFO, self.jabberID)
-               text = lang.get(self.session.lang).msnDisconnected % reason
-               self.session.sendMessage(to=self.jabberID, fro=config.jid, body=text)
+               if reason.type != error.ConnectionDone:
+                       text = lang.get(self.session.lang).msnDisconnected % reason
+                       self.session.sendMessage(to=self.jabberID, fro=config.jid, body=text)
                self.session.removeMe() # Tear down the session
 
        def multipleLogin(self):