]> code.delx.au - pymsnt/commitdiff
Fixed iq error responses to include xmlns
authorjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Thu, 30 Mar 2006 08:52:17 +0000 (08:52 +0000)
committerjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Thu, 30 Mar 2006 08:52:17 +0000 (08:52 +0000)
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>

src/disco.py
src/jabw.py
src/legacy/glue.py
src/tlib/msn/msnw.py

index 3e93a9b017750cc2d298e91edc78ee57970bf081..53654ad2ab1387ab0a1fcc716d6efa1cb4117400 100644 (file)
@@ -232,6 +232,7 @@ class ServerDiscovery:
                error.attributes["type"] = etype
                error.attributes["code"] = str(utils.errorCodeMap[condition])
                cond = error.addElement(condition)
+               cond.attributes["xmlns"] = XMPP_STANZAS
                self.pytrans.send(el)
 
 
index fec844b3cc55d1f8b58cb70fef739dd83d6da1cc..71058369d1af6894f39ce9ba19db1b87a6876064 100644 (file)
@@ -82,9 +82,9 @@ def sendErrorMessage(pytrans, to, fro, etype, condition, explanation, body=None)
        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")
index 176932f247e1a6f743bd5e0d1d48cfaf9cfa9d81..30f05818ee5937700949e868fa5f886021906554 100644 (file)
@@ -116,6 +116,7 @@ def presence2state(show, ptype):
                return msn.STATUS_BUSY
        elif show == "away" or show == "xa":
                return msn.STATUS_AWAY
+       return msn.STATUS_ONLINE
 
 
 def state2presence(state):
index 7f72f2df5945bf81f3d81587fe41a169b1ef321a..c4f7c34fbca500deaa97722b3b81f547a1aab2a8 100644 (file)
@@ -189,6 +189,8 @@ class MSNConnection:
                """
 
                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):
@@ -198,7 +200,6 @@ class MSNConnection:
                        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
@@ -233,6 +234,9 @@ class MSNConnection:
                        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)