]> code.delx.au - pymsnt/blobdiff - src/tlib/msn/msnw.py
Handle disconnects better.
[pymsnt] / src / tlib / msn / msnw.py
index d352cbe4491b21727dcf9a247d9bf991d9159cd4..87ed0442623ce420d1881590cf7059ed98383447 100644 (file)
@@ -231,10 +231,11 @@ class MSNConnection:
                        self.notificationClient.logOut()
                for c in self.connectors:
                        c.disconnect()
+               self.connectors = []
                if self.notificationFactory:
                        self.notificationFactory.stopTrying()
                        self.notificationFactory.msncon = None
-               self.connectors = []
+                       self.notificationFactory = None
                for sbs in self.switchboardSessions.values():
                        if hasattr(sbs, "transport") and sbs.transport:
                                sbs.transport.loseConnection()
@@ -388,7 +389,7 @@ class NotificationClient(msn.NotificationClient):
                # are now redundant
                self.loginFailure = self.doDisconnect
                self.loggedIn = self.doDisconnect
-               self.connectionLost = self.doDisconnect
+               self.connectionLost = lambda reason: msn.NotificationClient.connectionLost(self, reason)
        
        def connectionLost(self, reason):
                if not self.factory.msncon: