From d61c6b1760b28051f551acd69a1f18962133bcb0 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 13 May 2012 21:07:00 +0100 Subject: muc.lib: Fix for traceback when no history length is set for the room --- plugins/muc/muc.lib.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index 0203df26..556916f2 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -135,7 +135,7 @@ function room_mt:broadcast_message(stanza, historic) stanza:tag("x", {xmlns = "jabber:x:delay", from = muc_domain, stamp = datetime.legacy()}):up(); -- XEP-0091 (deprecated) local entry = { stanza = stanza, stamp = stamp }; t_insert(history, entry); - while #history > self._data.history_length do t_remove(history, 1) end + while #history > (self._data.history_length or default_history_length) do t_remove(history, 1) end end end function room_mt:broadcast_except_nick(stanza, nick) -- cgit v1.2.3