aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_message.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_message.lua')
-rw-r--r--plugins/mod_message.lua13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/mod_message.lua b/plugins/mod_message.lua
index 6ac23ab2..bd4e353a 100644
--- a/plugins/mod_message.lua
+++ b/plugins/mod_message.lua
@@ -44,14 +44,17 @@ local function process_to_bare(bare, origin, stanza)
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/store', {
+ origin = origin,
+ stanza = stanza,
+ });
+ end
+
+ if not ok then
origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
end
end