diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-06-01 09:49:37 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-06-01 09:49:37 +0500 |
commit | 5cc04f17ace7e1eaff427e54e178f9bbbccb6acb (patch) | |
tree | 141faf36bb07c6a37087bc539a767373f0ffec94 /plugins | |
parent | a76311bca74ca7cda677497ea9639757f8502884 (diff) | |
download | prosody-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')
-rw-r--r-- | plugins/mod_iq.lua | 8 |
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) |