mod_muc: Use enum config API for 'restrict_room_creation'

This communicates the accepted values in case the config diverges from
them. Note that older documentation used an "admin" value behaving like
an alias to true, but this is no longer handled. Should it?
pull/27/head
Kim Alvefur 3 years ago
parent 69e11f7524
commit 1d955bd1f3
  1. 2
      plugins/muc/mod_muc.lua

@ -412,7 +412,7 @@ if module:get_option_boolean("muc_tombstones", true) then
end, -10);
end
local restrict_room_creation = module:get_option("restrict_room_creation");
local restrict_room_creation = module:get_option_enum("restrict_room_creation", false, true, "local");
module:default_permission(restrict_room_creation == true and "prosody:admin" or "prosody:registered", ":create-room");
module:hook("muc-room-pre-create", function(event)
local origin, stanza = event.origin, event.stanza;

Loading…
Cancel
Save