Changeset

666:b42b75f3bda0

mod_mam: Add the UID to the <result> when sending an archived message back.
author Thijs Alkemade <thijsalkemade@gmail.com>
date Mon, 21 May 2012 15:36:02 +0200
parents 665:684cc57a49c1
children 667:ea9941812721
files mod_mam/mod_mam.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_mam/mod_mam.lua	Wed May 16 17:34:47 2012 +0500
+++ b/mod_mam/mod_mam.lua	Mon May 21 15:36:02 2012 +0200
@@ -139,6 +139,7 @@
 			local item = data[i];
 			local when, with, with_bare = item.when, item.with, item.with_bare;
 			local ts = item.timestamp;
+			local id = item.id;
 			--module:log("debug", "message with %s at %s", with, when or "???");
 			-- Apply query filter
 			if (not qwith or ((qwith == with) or (qwith == with_bare)))
@@ -147,7 +148,7 @@
 				-- Optimizable? Do this when archiving?
 				--module:log("debug", "sending");
 				local fwd_st = st.message{ to = origin.full_jid }
-					:tag("result", { xmlns = xmlns_mam, queryid = qid }):up()
+					:tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }):up()
 					:tag("forwarded", { xmlns = xmlns_forward })
 						:tag("delay", { xmlns = xmlns_delay, stamp = ts or timestamp(when) }):up();
 				local orig_stanza = st.deserialize(item.stanza);