Fixed exception with MSNConnection.connectionFailed
git-svn-id: http://delx.cjb.net/svn/pymsnt/trunk@133
55fbd22a-6204-0410-b2f0-
b6c764c7e90a
committer: jamesbunton <jamesbunton@
55fbd22a-6204-0410-b2f0-
b6c764c7e90a>
error.attributes["type"] = etype
error.attributes["code"] = str(utils.errorCodeMap[condition])
cond = error.addElement(condition)
+ cond.attributes["xmlns"] = XMPP_STANZAS
self.pytrans.send(el)
error.attributes["type"] = etype
error.attributes["code"] = str(utils.errorCodeMap[condition])
desc = error.addElement(condition)
- desc.attributes["xmlns"] = "urn:ietf:params:xml:ns:xmpp-stanzas"
+ desc.attributes["xmlns"] = XMPP_STANZAS
text = error.addElement("text")
- text.attributes["xmlns"] = "urn:ietf:params:xml:ns:xmpp-stanzas"
+ text.attributes["xmlns"] = XMPP_STANZAS
text.addContent(explanation)
if(body and len(body) > 0):
b = el.addElement("body")
return msn.STATUS_BUSY
elif show == "away" or show == "xa":
return msn.STATUS_AWAY
+ return msn.STATUS_ONLINE
def state2presence(state):
"""
if not screenName: screenName = self.username
+ if not statusCode: statusCode = msn.STATUS_ONLINE
+ if not personal: personal = ""
if self.notificationClient:
changeCount = [0] # Hack
def cb(ignored=None):
LogEvent(INFO, self.ident)
self.notificationClient.changeStatus(statusCode.encode("utf-8")).addCallback(cb)
self.notificationClient.changeScreenName(screenName.encode("utf-8")).addCallback(cb)
- if not personal: personal = ""
self.notificationClient.changePersonalMessage(personal.encode("utf-8")).addCallback(cb)
else:
self.savedEvents.statusCode = statusCode
if hasattr(sbs, "transport") and sbs.transport:
sbs.transport.loseConnection()
self.switchboardSessions = {}
+ if self.timeout:
+ self.timeout.cancel()
+ self.timeout = None
LogEvent(INFO, self.ident)