Mon, 01 Jun 2009 09:49:37 +0500
mod_iq: Error reply for IQ to non-existing session. mod_iq now handles all 'iq/full' cases
plugins/mod_iq.lua | file | annotate | diff | comparison | revisions |
--- a/plugins/mod_iq.lua Mon Jun 01 02:10:19 2009 +0100 +++ b/plugins/mod_iq.lua Mon Jun 01 09:49:37 2009 +0500 @@ -1,3 +1,5 @@ + +local st = require "util.stanza"; local full_sessions = full_sessions; local bare_sessions = bare_sessions; @@ -10,10 +12,12 @@ if session then -- TODO fire post processing event session.send(stanza); - return true; else -- resource not online - -- TODO error reply + if stanza.attr.type == "get" or stanza.attr.type == "set" then + origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); + end end + return true; end); module:hook("iq/bare", function(data)