Software /
code /
prosody
Changeset
4038:1bd93c6ac3bd
mod_message: Send service-unavailable if offline storage fails.
author | Robert Hoelz <rob@hoelz.ro> |
---|---|
date | Thu, 09 Dec 2010 12:36:29 -0600 |
parents | 4037:5262d3eb7f01 |
children | 4039:1c387a4c3e28 |
files | plugins/mod_message.lua |
diffstat | 1 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_message.lua Thu Dec 09 12:28:05 2010 -0600 +++ b/plugins/mod_message.lua Thu Dec 09 12:36:29 2010 -0600 @@ -44,14 +44,17 @@ 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