From 5cc04f17ace7e1eaff427e54e178f9bbbccb6acb Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 1 Jun 2009 09:49:37 +0500 Subject: mod_iq: Error reply for IQ to non-existing session. mod_iq now handles all 'iq/full' cases --- plugins/mod_iq.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_iq.lua b/plugins/mod_iq.lua index fc79e92c..8ccd820f 100644 --- a/plugins/mod_iq.lua +++ b/plugins/mod_iq.lua @@ -1,4 +1,6 @@ +local st = require "util.stanza"; + local full_sessions = full_sessions; local bare_sessions = bare_sessions; @@ -10,10 +12,12 @@ module:hook("iq/full", function(data) 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) -- cgit v1.2.3