]> code.delx.au - pymsnt/blobdiff - src/tlib/msn/msnw.py
Use vCard fullname if nickname isn't around.
[pymsnt] / src / tlib / msn / msnw.py
index 332146cf9c09e9eadfbcb478762d65503040976c..6b58f50ed0097698ccb2621451218dc5bce07e87 100644 (file)
@@ -7,7 +7,7 @@ from twisted.internet.defer import Deferred
 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
@@ -50,7 +50,9 @@ class MSNConnection:
 
        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
@@ -219,7 +221,7 @@ class MSNConnection:
        
        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:
@@ -623,7 +625,7 @@ class OneSwitchboardSession(SwitchboardSessionBase):
                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)