Don't report connectionLost(ConnectionDone)
git-svn-id: http://delx.cjb.net/svn/pymsnt/trunk@166
55fbd22a-6204-0410-b2f0-
b6c764c7e90a
committer: jamesbunton <jamesbunton@
55fbd22a-6204-0410-b2f0-
b6c764c7e90a>
import os.path
import utils
import os.path
import utils
-from twisted.internet import task
+from twisted.internet import task, error
from tlib.xmlw import Element
from tlib import msn
from debug import LogEvent, INFO, WARN, ERROR
from tlib.xmlw import Element
from tlib import msn
from debug import LogEvent, INFO, WARN, ERROR
def connectionLost(self, reason):
LogEvent(INFO, self.jabberID)
def connectionLost(self, reason):
LogEvent(INFO, self.jabberID)
- text = lang.get(self.session.lang).msnDisconnected % reason
- self.session.sendMessage(to=self.jabberID, fro=config.jid, body=text)
+ if reason.type != error.ConnectionDone:
+ text = lang.get(self.session.lang).msnDisconnected % reason
+ self.session.sendMessage(to=self.jabberID, fro=config.jid, body=text)
self.session.removeMe() # Tear down the session
def multipleLogin(self):
self.session.removeMe() # Tear down the session
def multipleLogin(self):
for c in self.connectors:
c.disconnect()
if self.notificationFactory:
for c in self.connectors:
c.disconnect()
if self.notificationFactory:
+ self.notificationFactory.stopTrying()
self.notificationFactory.msncon = None
self.connectors = []
for sbs in self.switchboardSessions.values():
self.notificationFactory.msncon = None
self.connectors = []
for sbs in self.switchboardSessions.values():
self.connectionLost = self.doDisconnect
def connectionLost(self, reason):
self.connectionLost = self.doDisconnect
def connectionLost(self, reason):
+ if not self.factory.msncon:
+ # If MSNConnection.logOut is called before _notificationClientReady
+ return
+
def wait():
LogEvent(INFO, self.factory.msncon.ident)
msn.NotificationClient.connectionLost(self, reason)
def wait():
LogEvent(INFO, self.factory.msncon.ident)
msn.NotificationClient.connectionLost(self, reason)