diff mod_mam/mod_mam.lua @ 705:c9d0ba39a33b

mod_mam: Move RSM pointer to last message into a MAM-namespaced child
author Kim Alvefur <zash@zash.se>
date Fri, 08 Jun 2012 20:11:39 +0200
parents d94ee0848b27
children 5c2b96c4dde6
line wrap: on
line diff
--- a/mod_mam/mod_mam.lua	Fri Jun 08 19:52:36 2012 +0200
+++ b/mod_mam/mod_mam.lua	Fri Jun 08 20:11:39 2012 +0200
@@ -197,7 +197,13 @@
 		end
 		-- That's all folks!
 		module:log("debug", "Archive query %s completed", tostring(qid));
-		origin.send(st.reply(stanza):add_child(rsm.generate{last = last}));
+
+		local reply = st.reply(stanza);
+		if last then
+			-- This is a bit redundant, isn't it?
+			reply:query(xmlns_mam):add_child(rsm.generate{last = last});
+		end
+		origin.send(reply);
 		return true
 	end
 end);