core.stanza_router: Don't bounce errors to iq type=result/error
authorMatthew Wild <mwild1@gmail.com>
Mon, 2 Mar 2009 19:45:44 +0000 (19:45 +0000)
committerMatthew Wild <mwild1@gmail.com>
Mon, 2 Mar 2009 19:45:44 +0000 (19:45 +0000)
core/stanza_router.lua

index 29a4797b5bf1c16b1f504d029a061e96d1b6c7b9..23b7a37d93a84990556686804658c4867764f52f 100644 (file)
@@ -273,7 +273,7 @@ function core_route_stanza(origin, stanza)
                                        end
                                        -- TODO allow configuration of offline storage
                                        -- TODO send error if not storing offline
-                               elseif stanza.name == "iq" then
+                               elseif stanza.name == "iq" and (stanza.attr.type == "get" or stanza.attr.type == "set") then
                                        origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
                                end
                        else -- user does not exist
@@ -284,7 +284,7 @@ function core_route_stanza(origin, stanza)
                                                origin.send(st.presence({from = to_bare, to = from_bare, type = "unsubscribed"}));
                                        end
                                        -- else ignore
-                               else
+                               elseif stanza.attr.type ~= "error" and (stanza.name ~= "iq" or stanza.attr.type ~= "result") then
                                        origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
                                end
                        end