306 for item in data:rows() do |
306 for item in data:rows() do |
307 local id, when, orig_stanza = unpack(item); |
307 local id, when, orig_stanza = unpack(item); |
308 --module:log("debug", "id is %s", id); |
308 --module:log("debug", "id is %s", id); |
309 |
309 |
310 local fwd_st = st.message{ to = origin.full_jid } |
310 local fwd_st = st.message{ to = origin.full_jid } |
311 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }):up() |
311 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }) |
312 :tag("forwarded", { xmlns = xmlns_forward }) |
312 :tag("forwarded", { xmlns = xmlns_forward }) |
313 :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up(); |
313 :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up(); |
314 orig_stanza = st.deserialize(deserialize(orig_stanza)); |
314 orig_stanza = st.deserialize(deserialize(orig_stanza)); |
315 orig_stanza.attr.xmlns = "jabber:client"; |
315 orig_stanza.attr.xmlns = "jabber:client"; |
316 fwd_st:add_child(orig_stanza); |
316 fwd_st:add_child(orig_stanza); |