]> code.delx.au - pymsnt/commitdiff
Send offline presence to users outside of session as well as message.
authorjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Tue, 30 May 2006 23:32:17 +0000 (23:32 +0000)
committerjamesbunton <jamesbunton@55fbd22a-6204-0410-b2f0-b6c764c7e90a>
Tue, 30 May 2006 23:32:17 +0000 (23:32 +0000)
git-svn-id: http://delx.cjb.net/svn/pymsnt/trunk@167 55fbd22a-6204-0410-b2f0-b6c764c7e90a

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

src/main.py

index 56f88130e1826e8c3fa28bd75756ea9d8fbe5346..a2a5b105c9cca7efe9ea7da13b25626b2d345b3c 100644 (file)
@@ -260,6 +260,7 @@ class PyTransport(component.Service):
                                        body = child.__str__()
                        LogEvent(INFO, "", "Sending error response to a message outside of session.")
                        jabw.sendErrorMessage(self, fro, to, "auth", "not-authorized", lang.get(ulang).notLoggedIn, body)
+                       jabw.sendPresence(self, fro, to, ptype="unavailable")
        
        def onPresence(self, el):
                fro = el.getAttribute("from")
@@ -298,11 +299,7 @@ class PyTransport(component.Service):
                                
                                elif el.getAttribute("type") != "error":
                                        LogEvent(INFO, "", "Sending unavailable presence to non-logged in user.")
-                                       pres = Element((None, "presence"))
-                                       pres.attributes["from"] = to
-                                       pres.attributes["to"] = fro
-                                       pres.attributes["type"] = "unavailable"
-                                       self.send(pres)
+                                       jabw.sendPresence(self, fro, to, ptype="unavailable")
                                        return
                        
                        elif ptype and (ptype.startswith("subscribe") or ptype.startswith("unsubscribe")):