aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_message.lua
diff options
context:
space:
mode:
authorRobert Hoelz <rob@hoelz.ro>2010-12-09 12:36:29 -0600
committerRobert Hoelz <rob@hoelz.ro>2010-12-09 12:36:29 -0600
commite448dd997f86e2883412bafa88e0811155719bf8 (patch)
tree755dda75df160e776ae13f3705e1e61670061869 /plugins/mod_message.lua
parent32c092ae0eb8551cd8fb8f124c0ae723672705f5 (diff)
downloadprosody-e448dd997f86e2883412bafa88e0811155719bf8.tar.gz
prosody-e448dd997f86e2883412bafa88e0811155719bf8.zip
mod_message: Send service-unavailable if offline storage fails.
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