# HG changeset patch # User Waqas Hussain # Date 1243831777 -18000 # Node ID 3f3c62e45eeb546ac85c4149369924d163deea10 # Parent 498293bce4bf5ba2db4f40438bd98965c83f7a25 mod_iq: Error reply for IQ to non-existing session. mod_iq now handles all 'iq/full' cases diff -r 498293bce4bf -r 3f3c62e45eeb plugins/mod_iq.lua --- 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)