comparison mod_mam/mod_mam.lua @ 1403:6b3db167374a

mod_mam: Mirror to and from attributes from iq on result messages
author Kim Alvefur <zash@zash.se>
date Wed, 30 Apr 2014 13:22:08 +0200
parents ce5e397a7768
children 53a3a19d6093
comparison
equal deleted inserted replaced
1402:57ee26681561 1403:6b3db167374a
113 if not data then 113 if not data then
114 return origin.send(st.error_reply(stanza, "cancel", "internal-server-error", err)); 114 return origin.send(st.error_reply(stanza, "cancel", "internal-server-error", err));
115 end 115 end
116 local count = err; 116 local count = err;
117 117
118 local msg_reply_attr = { to = stanza.attr.from, from = stanza.attr.to };
119
118 -- Wrap it in stuff and deliver 120 -- Wrap it in stuff and deliver
119 local first, last; 121 local fwd_st, first, last;
120 for id, item, when in data do 122 for id, item, when in data do
121 local fwd_st = st.message{ to = origin.full_jid } 123 fwd_st = st.message(msg_reply_attr)
122 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }) 124 :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id })
123 :tag("forwarded", { xmlns = xmlns_forward }) 125 :tag("forwarded", { xmlns = xmlns_forward })
124 :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up(); 126 :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up();
125 127
126 if not is_stanza(item) then 128 if not is_stanza(item) then