plugins/muc/history.lib.lua
changeset 11715 6fbbfa4a1178
parent 11184 ab820b2ad199
child 12981 74b9e05af71e
--- a/plugins/muc/history.lib.lua	Sun Jul 18 23:25:45 2021 +0200
+++ b/plugins/muc/history.lib.lua	Mon Jul 19 17:07:59 2021 +0200
@@ -173,6 +173,10 @@
 -- add to history
 module:hook("muc-add-history", function(event)
 	local room = event.room
+	if get_historylength(room) == 0 then
+		room._history = nil;
+		return;
+	end
 	local history = room._history;
 	if not history then history = {}; room._history = history; end
 	local stanza = st.clone(event.stanza);