From 2ad8575dae2650faf8717835d00725970f826ff4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 7 Mar 2018 17:53:52 +0100 Subject: MUC: Return error if unable to keep track of room due to storage failure --- plugins/muc/mod_muc.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/muc') diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua index a3c6cb81..6ba0ffb5 100644 --- a/plugins/muc/mod_muc.lua +++ b/plugins/muc/mod_muc.lua @@ -253,8 +253,12 @@ module:hook("host-disco-items", function(event) end end); -module:hook("muc-room-created", function(event) - track_room(event.room); +module:hook("muc-room-pre-create", function(event) + local origin, stanza = event.origin, event.stanza; + if not track_room(event.room) then + origin.send(st.error_reply(stanza, "wait", "resource-constraint")); + return true; + end end, -1000); module:hook("muc-room-destroyed",function(event) -- cgit v1.2.3