Allow chat admin to delete channels (#69)

master
SX 2022-08-28 06:58:15 +03:00 committed by GitHub
parent 19aafbe238
commit 98aa631170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -93,7 +93,7 @@ local delete_channel = {
return false, "ERROR: Channel " .. param .. " does not exist"
end
if name ~= beerchat.channels[param].owner then
if name ~= beerchat.channels[param].owner and not minetest.check_player_privs(name, beerchat.admin_priv) then
return false, "ERROR: You are not the owner of channel " .. param
end

View File

@ -9,6 +9,9 @@ beerchat = {
-- The main channel is the one you send messages to when no channel is specified
main_channel_name = minetest.settings:get("beerchat.main_channel_name") or "main",
-- Chat administrator privilege allows bypassing owner checks
admin_priv = minetest.settings:get("beerchat.admin_priv") or "server",
-- The default color of channels when no color is specified
default_channel_color = "#ffffff",