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
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):
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.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)