24 |
24 |
25 module:hook("iq/bare", function(data) |
25 module:hook("iq/bare", function(data) |
26 -- IQ to bare JID recieved |
26 -- IQ to bare JID recieved |
27 local origin, stanza = data.origin, data.stanza; |
27 local origin, stanza = data.origin, data.stanza; |
28 |
28 |
29 if not bare_sessions[stanza.attr.to] then -- quick check for account existance |
29 local to = stanza.attr.to; |
30 local node, host = jid_split(stanza.attr.to); |
30 if to and not bare_sessions[to] then -- quick check for account existance |
|
31 local node, host = jid_split(to); |
31 if not user_exists(node, host) then -- full check for account existance |
32 if not user_exists(node, host) then -- full check for account existance |
32 if stanza.attr.type == "get" or stanza.attr.type == "set" then |
33 if stanza.attr.type == "get" or stanza.attr.type == "set" then |
33 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
34 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
34 end |
35 end |
35 return true; |
36 return true; |