mod_mam_muc/mod_mam_muc.lua
changeset 2836 15a9d508c5f7
parent 2835 d65868fed77a
child 2837 4f9466be7b46
equal deleted inserted replaced
2835:d65868fed77a 2836:15a9d508c5f7
   229 
   229 
   230 	if not data then
   230 	if not data then
   231 		origin.send(st.error_reply(stanza, "cancel", "internal-server-error"));
   231 		origin.send(st.error_reply(stanza, "cancel", "internal-server-error"));
   232 		return true;
   232 		return true;
   233 	end
   233 	end
       
   234 	local total = tonumber(err);
   234 
   235 
   235 	local msg_reply_attr = { to = stanza.attr.from, from = stanza.attr.to };
   236 	local msg_reply_attr = { to = stanza.attr.from, from = stanza.attr.to };
   236 
   237 
   237 	local results = {};
   238 	local results = {};
   238 
   239 
   286 	module:log("debug", "Archive query %s completed", tostring(qid));
   287 	module:log("debug", "Archive query %s completed", tostring(qid));
   287 
   288 
   288 	origin.send(st.reply(stanza)
   289 	origin.send(st.reply(stanza)
   289 		:tag("fin", { xmlns = xmlns_mam, queryid = qid, complete = complete })
   290 		:tag("fin", { xmlns = xmlns_mam, queryid = qid, complete = complete })
   290 			:add_child(rsm.generate {
   291 			:add_child(rsm.generate {
   291 				first = first, last = last }));
   292 				first = first, last = last, count = total }));
   292 	return true;
   293 	return true;
   293 end);
   294 end);
   294 
   295 
   295 module:hook("muc-get-history", function (event)
   296 module:hook("muc-get-history", function (event)
   296 	local room = event.room;
   297 	local room = event.room;