diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-06-01 11:16:48 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-06-01 11:16:48 +0500 |
commit | 53d04613aa3290e9a816271e61646f4cc8d03de7 (patch) | |
tree | d2a8b294fbf761b9d41471c813f86f7faf3394c5 /plugins/mod_iq.lua | |
parent | 40c0526f7c3b8b8ed1a9ea30f3a2826d01427863 (diff) | |
download | prosody-53d04613aa3290e9a816271e61646f4cc8d03de7.tar.gz prosody-53d04613aa3290e9a816271e61646f4cc8d03de7.zip |
mod_iq: Correctly handle the lack of 'to' on IQs
Diffstat (limited to 'plugins/mod_iq.lua')
-rw-r--r-- | plugins/mod_iq.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_iq.lua b/plugins/mod_iq.lua index 046bebd6..73e5688e 100644 --- a/plugins/mod_iq.lua +++ b/plugins/mod_iq.lua @@ -26,8 +26,9 @@ module:hook("iq/bare", function(data) -- IQ to bare JID recieved local origin, stanza = data.origin, data.stanza; - if not bare_sessions[stanza.attr.to] then -- quick check for account existance - local node, host = jid_split(stanza.attr.to); + local to = stanza.attr.to; + if to and not bare_sessions[to] then -- quick check for account existance + local node, host = jid_split(to); if not user_exists(node, host) then -- full check for account existance if stanza.attr.type == "get" or stanza.attr.type == "set" then origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |