aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_iq.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-06-01 09:49:37 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-06-01 09:49:37 +0500
commit5cc04f17ace7e1eaff427e54e178f9bbbccb6acb (patch)
tree141faf36bb07c6a37087bc539a767373f0ffec94 /plugins/mod_iq.lua
parenta76311bca74ca7cda677497ea9639757f8502884 (diff)
downloadprosody-5cc04f17ace7e1eaff427e54e178f9bbbccb6acb.tar.gz
prosody-5cc04f17ace7e1eaff427e54e178f9bbbccb6acb.zip
mod_iq: Error reply for IQ to non-existing session. mod_iq now handles all 'iq/full' cases
Diffstat (limited to 'plugins/mod_iq.lua')
-rw-r--r--plugins/mod_iq.lua8
1 files changed, 6 insertions, 2 deletions
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)