Software /
code /
prosody-modules
Comparison
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 |
comparison
equal
deleted
inserted
replaced
1745:851cb0b3d584 | 1746:5734a6199938 |
---|---|
245 if shall_store(store_user, with) then | 245 if shall_store(store_user, with) then |
246 module:log("debug", "Archiving stanza: %s", stanza:top_tag()); | 246 module:log("debug", "Archiving stanza: %s", stanza:top_tag()); |
247 | 247 |
248 -- And stash it | 248 -- And stash it |
249 local ok, id = archive:append(store_user, nil, time_now(), with, stanza); | 249 local ok, id = archive:append(store_user, nil, time_now(), with, stanza); |
250 if ok then | |
251 module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id }); | |
252 end | |
250 else | 253 else |
251 module:log("debug", "Not archiving stanza: %s (prefs)", stanza:top_tag()); | 254 module:log("debug", "Not archiving stanza: %s (prefs)", stanza:top_tag()); |
252 end | 255 end |
253 end | 256 end |
254 | 257 |