Merge with 0.4.1
[prosody.git] / plugins / mod_presence.lua
index 7b521c5096d03962594ca35d4d02a7bbd6d6f3b0..2e3c6b18d753e894e7c907657c21a5962ad02b46 100644 (file)
@@ -240,7 +240,7 @@ local function presence_handler(data)
                        origin.directed = origin.directed or {};\r
                        origin.directed[to] = true;\r
                end\r
-               if to == nil and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then\r
+               if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then\r
                        handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza);\r
                elseif not to then\r
                        handle_normal_presence(origin, stanza, core_route_stanza);\r
@@ -248,7 +248,7 @@ local function presence_handler(data)
                        core_route_stanza(origin, stanza);\r
                end\r
        elseif (origin.type == "s2sin" or origin.type == "component") and hosts[host] then\r
-               if to == nil and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then\r
+               if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then\r
                        handle_inbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare, core_route_stanza);\r
                else\r
                        core_route_stanza(origin, stanza);\r