changeset 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
parents 851cb0b3d584
children 985e05ac833b
files mod_mam/mod_mam.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
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