# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1479576548 -3600
# Node ID 22275bc5744a5f9bae01d83edf3db61af01e9a54
# Parent  eeb22f9125774b1b5b0fbf0138453690421c1eb3
mod_mam: Add XEP-0359 tag

diff -r eeb22f912577 -r 22275bc5744a plugins/mod_mam/mod_mam.lua
--- a/plugins/mod_mam/mod_mam.lua	Sat Nov 19 18:28:59 2016 +0100
+++ b/plugins/mod_mam/mod_mam.lua	Sat Nov 19 18:29:08 2016 +0100
@@ -272,6 +272,7 @@
 		-- And stash it
 		local ok, id = archive:append(store_user, nil, stanza, time_now(), with);
 		if ok then
+			stanza:tag("stanza-id", { xmlns = "urn:xmpp:sid:0", by = store_user.."@"..host, id = id }):up();
 			if cleanup then cleanup[store_user] = true; end
 			module:fire_event("archive-message-added", { origin = origin, stanza = stanza, for_user = store_user, id = id });
 		end