from twisted.internet.protocol import ClientFactory
# System imports
-import math, base64, binascii, math
+import math, base64, binascii
# Local imports
from debug import LogEvent, INFO, WARN, ERROR
def _getNotificationReferral(self):
def timeout():
- if not d.called: d.errback()
+ if not d.called:
+ d.errback()
+ self.logOut() # Clean up everything
self.timeout = reactor.callLater(30, timeout)
dispatchFactory = msn.DispatchFactory()
dispatchFactory.userHandle = self.username
def logOut(self):
""" Shuts down the whole connection. Don't try to call any
- other methods after this one. """
+ other methods after this one. Except maybe connect() """
if self.notificationClient:
self.notificationClient.logOut()
for c in self.connectors:
self.timeout = None
for message, noerror in self.messageBuffer:
if not noerror:
- self.failedMessage(self.remoteUser, message)
+ self.failedMessage(message)
def _ready(self):
LogEvent(INFO, self.ident)