diff 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
line wrap: on
line diff
--- a/mod_mam/mod_mam.lua	Wed Apr 30 13:19:47 2014 +0200
+++ b/mod_mam/mod_mam.lua	Wed Apr 30 13:22:08 2014 +0200
@@ -115,10 +115,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 = origin.full_jid }
+		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();