aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-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)