Software /
code /
prosody-modules
Comparison
mod_mam_sql/mod_mam_sql.lua @ 1388:6e1facedcb74
mam_sql: Make forwarded a child element of result, rather than a sibling
This makes mod_mam_sql conform to a newer version of XEP-313, which some
clients require
author | Rob Hoelz <rob@hoelz.ro> |
---|---|
date | Tue, 22 Apr 2014 20:16:40 -0500 |
parent | 1343:7dbde05b48a9 |
comparison
equal
deleted
inserted
replaced
1387:db2ff8f29472 | 1388:6e1facedcb74 |
---|---|
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); |