]> code.delx.au - pymsnt/commitdiff
Notice switchboard session disconnects properly.
authorjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Thu, 15 Jun 2006 14:03:39 +0000 (14:03 +0000)
committerjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Thu, 15 Jun 2006 14:03:39 +0000 (14:03 +0000)
Also report failedMessage error codes with messages over 1400 in size.

git-svn-id: http://delx.cjb.net/svn/pymsnt/trunk@175 55fbd22a-6204-0410-b2f0-b6c764c7e90a

committer: jamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>

src/tlib/msn/msnw.py

index b5d47caf93b9c188bc6183aabd0cf7a0242b16f9..7f47291be6bea8ab8271e026dec36721ffbb418b 100644 (file)
@@ -582,7 +582,7 @@ class SwitchboardSessionBase(msn.SwitchboardClient):
 
                                        d = msn.SwitchboardClient.sendMessage(self, message)
                                        if not noerror:
-                                               d.addCallback(failedMessage)
+                                               d.addCallbacks(failedMessage, failedMessage)
 
                                        chunk += 1
 
@@ -652,6 +652,11 @@ class OneSwitchboardSession(SwitchboardSessionBase):
                        if not noerror:
                                self.failedMessage(message)
                self.messageBuffer = []
+
+               if self.msncon and self.msncon.switchboardSessions.has_key(self.remoteUser):
+                       # Unexpected disconnection. Must remove us from msncon
+                       self.msncon.switchboardSessions.pop(self.remoteUser)
+
                SwitchboardSessionBase.connectionLost(self, reason)
 
        def _ready(self):