Mercurial > prosody-modules
comparison mod_mam/mod_mam.lua @ 1093:959e38a41a2e
mod_mam: The forwarded message should be a child of the MAM result element
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 30 Jun 2013 00:40:04 +0200 |
parents | ce8bb0386d08 |
children | 158680bff642 |
comparison
equal
deleted
inserted
replaced
1092:f46307e8e2f8 | 1093:959e38a41a2e |
---|---|
191 if (not qwith or ((qwith == with) and (not qres or qres == resource))) | 191 if (not qwith or ((qwith == with) and (not qres or qres == resource))) |
192 and (not qstart or when >= qstart) | 192 and (not qstart or when >= qstart) |
193 and (not qend or when <= qend) | 193 and (not qend or when <= qend) |
194 and (not qset or qset_matches) then | 194 and (not qset or qset_matches) then |
195 local fwd_st = st.message{ to = origin.full_jid } | 195 local fwd_st = st.message{ to = origin.full_jid } |
196 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }):up() | 196 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }) |
197 :tag("forwarded", { xmlns = xmlns_forward }) | 197 :tag("forwarded", { xmlns = xmlns_forward }) |
198 :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up(); | 198 :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up(); |
199 local orig_stanza = st.deserialize(item.stanza); | 199 local orig_stanza = st.deserialize(item.stanza); |
200 orig_stanza.attr.xmlns = "jabber:client"; | 200 orig_stanza.attr.xmlns = "jabber:client"; |
201 fwd_st:add_child(orig_stanza); | 201 fwd_st:add_child(orig_stanza); |
202 if reverse then | 202 if reverse then |
203 t_insert(results, 1, fwd_st); | 203 t_insert(results, 1, fwd_st); |