Diff

mod_mam_muc/mod_mam_muc.lua @ 1650:66d67f0bae16

mod_mam_muc: Cleanup [luacheck]
author Kim Alvefur <zash@zash.se>
date Tue, 07 Apr 2015 17:34:43 +0200
parent 1649:ab4073468dfb
child 1679:c77e9522dc66
line wrap: on
line diff
--- a/mod_mam_muc/mod_mam_muc.lua	Tue Apr 07 17:34:22 2015 +0200
+++ b/mod_mam_muc/mod_mam_muc.lua	Tue Apr 07 17:34:43 2015 +0200
@@ -17,7 +17,6 @@
 
 -- Support both old and new MUC code
 local mod_muc = module:depends"muc";
-local room_mt = mod_muc.room_mt;
 local rooms = rawget(mod_muc, "rooms");
 local each_room = rawget(mod_muc, "each_room") or function() return it.values(rooms); end;
 local new_muc = not rooms;
@@ -268,7 +267,7 @@
 
 	local history, i = {}, 1;
 
-	for id, item, when in data do
+	for _, item, when in data do
 		item.attr.to = to;
 		item:tag("delay", { xmlns = "urn:xmpp:delay", from = room_jid, stamp = timestamp(when) }):up(); -- XEP-0203
 		if maxchars then
@@ -281,7 +280,7 @@
 		history[i], i = item, i+1;
 		-- module:log("debug", tostring(item));
 	end
-	function event:next_stanza()
+	function event.next_stanza()
 		i = i - 1;
 		return history[i];
 	end
@@ -322,7 +321,6 @@
 
 -- Handle messages
 function save_to_history(self, stanza)
-	local orig_to = stanza.attr.to;
 	local room = jid_split(self.jid);
 
 	-- Policy check