# HG changeset patch # User Robert Hoelz # Date 1291919789 21600 # Node ID 0f9ab57a1aee80885cd53acab6a9f76c48eefc24 # Parent 32d4a73901e2c985bb0aa37c413d4f5c24a810f4 mod_message: Send service-unavailable if offline storage fails. diff -r 32d4a73901e2 -r 0f9ab57a1aee plugins/mod_message.lua --- 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