# HG changeset patch # User Kim Alvefur # Date 1520441632 -3600 # Node ID 3b54f8472b51954fd0425928b0c004274dd36605 # Parent 4006755c1097d448b140784cd6daa582871bfb97 MUC: Return error if unable to keep track of room due to storage failure diff -r 4006755c1097 -r 3b54f8472b51 plugins/muc/mod_muc.lua --- a/plugins/muc/mod_muc.lua Fri Mar 16 21:59:41 2018 +0100 +++ b/plugins/muc/mod_muc.lua Wed Mar 07 17:53:52 2018 +0100 @@ -253,8 +253,12 @@ 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)