Mercurial > prosody-hg
comparison plugins/mod_message.lua @ 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 | 32b55f06a3bd |
| children | a05cf5d9c7ab |
comparison
equal
deleted
inserted
replaced
| 4037:5262d3eb7f01 | 4038:1bd93c6ac3bd |
|---|---|
| 42 return true; | 42 return true; |
| 43 end | 43 end |
| 44 end | 44 end |
| 45 -- no resources are online | 45 -- no resources are online |
| 46 local node, host = jid_split(bare); | 46 local node, host = jid_split(bare); |
| 47 local ok | |
| 47 if user_exists(node, host) then | 48 if user_exists(node, host) then |
| 48 -- TODO apply the default privacy list | 49 -- TODO apply the default privacy list |
| 49 | 50 |
| 50 module:fire_event('message/offline/store', { | 51 ok = module:fire_event('message/offline/store', { |
| 51 origin = origin, | 52 origin = origin, |
| 52 stanza = stanza, | 53 stanza = stanza, |
| 53 }); | 54 }); |
| 54 else | 55 end |
| 56 | |
| 57 if not ok then | |
| 55 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); | 58 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); |
| 56 end | 59 end |
| 57 end | 60 end |
| 58 return true; | 61 return true; |
| 59 end | 62 end |
