From 97e2ded4fb5bef88df8eb2b771a6ed54e0cec1ac Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Fri, 4 Dec 2020 12:24:07 +0100 Subject: [PATCH] Some minor changes --- server/src/client/command_handler/channel.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/client/command_handler/channel.cpp b/server/src/client/command_handler/channel.cpp index 57e5d99..18cc3b2 100644 --- a/server/src/client/command_handler/channel.cpp +++ b/server/src/client/command_handler/channel.cpp @@ -672,7 +672,9 @@ command_result ConnectedClient::handleCommandChannelCreate(Command &cmd) { test_permission(true, permission::b_channel_create_with_sortorder); } else if (key == "channel_flag_default") { - test_permission(true, permission::b_channel_create_with_default); + if(cmd["channel_flag_default"].as()) { + test_permission(true, permission::b_channel_create_with_default); + } } else if (key == "channel_name" ||key == "channel_name_phonetic") { /* channel create requires a name */ } else if (key == "channel_topic") { @@ -1039,7 +1041,9 @@ command_result ConnectedClient::handleCommandChannelEdit(Command &cmd) { } else if (key == "channel_order") { ACTION_REQUIRES_PERMISSION(permission::b_channel_modify_sortorder, 1, channel_id); } else if (key == "channel_flag_default") { - ACTION_REQUIRES_GLOBAL_PERMISSION(permission::b_channel_modify_make_default, 1); + if(cmd["channel_flag_default"].as()) { + ACTION_REQUIRES_GLOBAL_PERMISSION(permission::b_channel_modify_make_default, 1); + } } else if (key == "channel_name") { ACTION_REQUIRES_PERMISSION(permission::b_channel_modify_name, 1, channel_id); } else if (key == "channel_name_phonetic") {