aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/history.lib.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/muc/history.lib.lua')
-rw-r--r--plugins/muc/history.lib.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/muc/history.lib.lua b/plugins/muc/history.lib.lua
index fdf65365..075b1890 100644
--- a/plugins/muc/history.lib.lua
+++ b/plugins/muc/history.lib.lua
@@ -173,6 +173,10 @@ end, 50); -- Before subject(20)
-- 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);