]> code.delx.au - pymsnt/blobdiff - src/tlib/msn/msnw.py
Fixed reconnecting problem (finally)
[pymsnt] / src / tlib / msn / msnw.py
index 6bce798c301925e2cf45abb7da0f941e2497accd..214ecaec987b360966dc63c8b1b0b31e7bdc93f9 100644 (file)
@@ -229,6 +229,7 @@ class MSNConnection:
                for c in self.connectors:
                        c.disconnect()
                if self.notificationFactory:
+                       self.notificationFactory.stopTrying()
                        self.notificationFactory.msncon = None
                self.connectors = []
                for sbs in self.switchboardSessions.values():
@@ -384,6 +385,10 @@ class NotificationClient(msn.NotificationClient):
                self.connectionLost = self.doDisconnect
        
        def connectionLost(self, reason):
+               if not self.factory.msncon:
+                       # If MSNConnection.logOut is called before _notificationClientReady
+                       return
+
                def wait():
                        LogEvent(INFO, self.factory.msncon.ident)
                        msn.NotificationClient.connectionLost(self, reason)