# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1372545604 -7200
# Node ID 959e38a41a2e89fed13520b0ac7255c2f79e88f2
# Parent  f46307e8e2f8ff5872f159c66aacf1575850709f
mod_mam: The forwarded message should be a child of the MAM result element

diff -r f46307e8e2f8 -r 959e38a41a2e mod_mam/mod_mam.lua
--- a/mod_mam/mod_mam.lua	Sun Jun 30 00:18:55 2013 +0200
+++ b/mod_mam/mod_mam.lua	Sun Jun 30 00:40:04 2013 +0200
@@ -193,9 +193,9 @@
 					and (not qend or when <= qend)
 					and (not qset or qset_matches) then
 				local fwd_st = st.message{ to = origin.full_jid }
-					:tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }):up()
-					:tag("forwarded", { xmlns = xmlns_forward })
-						:tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up();
+					:tag("result", { xmlns = xmlns_mam, queryid = qid, id = id })
+						:tag("forwarded", { xmlns = xmlns_forward })
+							:tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up();
 				local orig_stanza = st.deserialize(item.stanza);
 				orig_stanza.attr.xmlns = "jabber:client";
 				fwd_st:add_child(orig_stanza);