diff options
author | Kim Alvefur <zash@zash.se> | 2018-03-07 17:53:52 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2018-03-07 17:53:52 +0100 |
commit | 2ad8575dae2650faf8717835d00725970f826ff4 (patch) | |
tree | 996e578a15fc2b80892f0444e708fce5b6442393 /plugins/muc | |
parent | 3ccd3d28f7c44b957dbaca575759452f014720ba (diff) | |
download | prosody-2ad8575dae2650faf8717835d00725970f826ff4.tar.gz prosody-2ad8575dae2650faf8717835d00725970f826ff4.zip |
MUC: Return error if unable to keep track of room due to storage failure
Diffstat (limited to 'plugins/muc')
-rw-r--r-- | plugins/muc/mod_muc.lua | 8 |
1 files changed, 6 insertions, 2 deletions
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) |