Software /
code /
prosody-modules
Diff
mod_mam/mod_mam.lua @ 1746:5734a6199938
mod_mam: Fire event on successful storage of message
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 18 May 2015 03:03:42 +0200 |
parent | 1737:2ee9725c7fc6 |
child | 1770:2c43e81236a3 |
line wrap: on
line diff
--- a/mod_mam/mod_mam.lua Mon May 18 02:58:17 2015 +0200 +++ b/mod_mam/mod_mam.lua Mon May 18 03:03:42 2015 +0200 @@ -247,6 +247,9 @@ -- And stash it local ok, id = archive:append(store_user, nil, time_now(), with, stanza); + if ok then + module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id }); + end else module:log("debug", "Not archiving stanza: %s (prefs)", stanza:top_tag()); end