class NotificationClient(msn.NotificationClient):
+ def doDisconnect(self):
+ if hasattr(self, "transport") and self.transport:
+ self.transport.loseConnection()
+
def loginFailure(self, message):
self.factory.msncon.loginFailed(message)
def logOut(self):
msn.NotificationClient.logOut(self)
+ # If we explicitly log out, then all of these events
+ # are now redundant
+ self.loginFailure = self.doDisconnect
+ self.loggedIn = self.doDisconnect
+ self.connectionLost = self.doDisconnect
def connectionLost(self, reason):
- if not self.factory.msncon: return # If we called logOut
def wait():
LogEvent(INFO, self.factory.msncon.ident)
msn.NotificationClient.connectionLost(self, reason)
self.ready = False
def __del__(self):
+ self.ready = False
LogEvent(INFO, self.ident)
del self.msncon
self.transport.disconnect()
def connectionLost(self, reason):
+ self.ready = False
self.msncon = None
self.msnobj = None
self.ident = (self.ident[0], self.ident[1] + " Disconnected!")