Changeset

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 704:57206f8f7b09
children 706:5c2b96c4dde6
files mod_mam/mod_mam.lua
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
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);