# HG changeset patch # User Kim Alvefur # Date 1413999172 -7200 # Node ID 4dd6eebc8fbd6e7950ee2a69311077b8194b029d # Parent 915bdcb35e79d0adc723a29ae71c806fda9239de mod_mam_muc: Minor moving about of variables diff -r 915bdcb35e79 -r 4dd6eebc8fbd mod_mam_muc/mod_mam_muc.lua --- a/mod_mam_muc/mod_mam_muc.lua Wed Oct 22 19:29:29 2014 +0200 +++ b/mod_mam_muc/mod_mam_muc.lua Wed Oct 22 19:32:52 2014 +0200 @@ -12,7 +12,10 @@ local rsm = module:require "mod_mam/rsm"; local jid_bare = require "util.jid".bare; local jid_split = require "util.jid".split; -local room_mt = module:depends"muc".room_mt; + +local mod_muc = module:depends"muc"; +local room_mt = mod_muc.room_mt; +local rooms = mod_muc.rooms; local getmetatable = getmetatable; local function is_stanza(x) @@ -40,8 +43,6 @@ return end -local rooms = hosts[module.host].modules.muc.rooms; - local send_history, save_to_history; -- Override history methods for all rooms. @@ -168,10 +169,12 @@ end local count = err; + local msg_reply_attr = { to = stanza.attr.from, from = stanza.attr.to }; + -- Wrap it in stuff and deliver - local first, last; + local fwd_st, first, last; for id, item, when in data do - local fwd_st = st.message{ to = orig_from, from = room } + fwd_st = st.message(msg_reply_attr) :tag("result", { xmlns = xmlns_mam, queryid = qid, id = id }) :tag("forwarded", { xmlns = xmlns_forward }) :tag("delay", { xmlns = xmlns_delay, stamp = timestamp(when) }):up();