Diff

mod_mam/mod_mam.lua @ 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
parent 635:30be50d2537f
child 671:74efb2db00a6
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);