core.stanza_router: Don't bounce errors to iq type=result/error

Mon, 02 Mar 2009 19:45:44 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 02 Mar 2009 19:45:44 +0000
changeset 854
b9cfc9d5496a
parent 853
c0a40522041e
child 855
57057f2cbecb

core.stanza_router: Don't bounce errors to iq type=result/error

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- a/core/stanza_router.lua	Mon Mar 02 19:44:46 2009 +0000
+++ b/core/stanza_router.lua	Mon Mar 02 19:45:44 2009 +0000
@@ -273,7 +273,7 @@
 					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 @@
 						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

mercurial