end
-- no resources are online
local node, host = jid_split(bare);
+ local ok
if user_exists(node, host) then
-- TODO apply the default privacy list
- module:fire_event('message/offline/store', {
- origin = origin,
- stanza = stanza,
- });
- else
+ ok = module:fire_event('message/offline/handle', {
+ origin = origin,
+ stanza = stanza,
+ });
+ end
+
+ if not ok then
origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
end
end