# HG changeset patch # User Kim Alvefur # Date 1396970888 -7200 # Node ID ba17268490b76d5448ee4ecc2afb9612c7db79e2 # Parent 11b6170a50f70f64798b73d31256a3b0fbe13b67 mod_mam_muc: Fix to, from on result messages (thanks daurnimator) diff -r 11b6170a50f7 -r ba17268490b7 mod_mam_muc/mod_mam_muc.lua --- a/mod_mam_muc/mod_mam_muc.lua Sat Apr 05 13:41:12 2014 +0200 +++ b/mod_mam_muc/mod_mam_muc.lua Tue Apr 08 17:28:08 2014 +0200 @@ -116,13 +116,14 @@ local origin, stanza = event.origin, event.stanza; local room = stanza.attr.to; local room_node = jid_split(room); + local orig_from = stanza.attr.from; local query = stanza.tags[1]; local room_obj = rooms[room]; if not room_obj then return origin.send(st.error_reply(stanza, "cancel", "item-not-found")) end - local from = jid_bare(stanza.attr.from); + local from = jid_bare(orig_from); -- Banned or not a member of a members-only room? local from_affiliation = room_obj:get_affiliation(from); @@ -173,7 +174,7 @@ -- Wrap it in stuff and deliver local first, last; for id, item, when in data do - local fwd_st = st.message{ to = origin.full_jid } + local fwd_st = st.message{ to = orig_from, from = room } :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }) :tag("forwarded", { xmlns = xmlns_forward }) :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up();