diff --git a/git-teaspeak b/git-teaspeak index e371401..5f0349e 160000 --- a/git-teaspeak +++ b/git-teaspeak @@ -1 +1 @@ -Subproject commit e371401bd35d10717c92e2e71d0b5d4d40577fa2 +Subproject commit 5f0349e5f930b4f0275c43518d01b9e8c57aa73a diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 9858bff..768570f 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -243,7 +243,7 @@ target_link_libraries(PermMapHelper SET(CPACK_PACKAGE_VERSION_MAJOR "1") SET(CPACK_PACKAGE_VERSION_MINOR "4") -SET(CPACK_PACKAGE_VERSION_PATCH "16") +SET(CPACK_PACKAGE_VERSION_PATCH "17") if (BUILD_TYPE_NAME EQUAL OFF) SET(CPACK_PACKAGE_VERSION_DATA "beta") elseif (BUILD_TYPE_NAME STREQUAL "") diff --git a/server/main.cpp b/server/main.cpp index 3fff787..3fd76d5 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -230,7 +230,6 @@ int main(int argc, char** argv) { if(true) return 0; */ - //debugMessage(LOG_GENERAL, "Sizeof ViewEntry {} Sizeof LinkedTreeEntry {} Sizeof shared_ptr {} Sizeof ClientChannelView {}", sizeof(ts::ViewEntry), sizeof(ts::TreeView::LinkedTreeEntry), sizeof(shared_ptr), sizeof(ts::ClientChannelView)); { //http://git.mcgalaxy.de/WolverinDEV/tomcrypt/blob/develop/src/misc/crypt/crypt_inits.c#L40-86 std::string descriptors = "LTGE"; diff --git a/server/src/Configuration.cpp b/server/src/Configuration.cpp index 4f0803c..84a28be 100644 --- a/server/src/Configuration.cpp +++ b/server/src/Configuration.cpp @@ -1,5 +1,6 @@ #include +#include #include "Configuration.h" #include "build.h" #include "../../license/shared/include/license/license.h" @@ -566,6 +567,14 @@ std::vector config::reload() { auto bindings = create_bindings(); read_bindings(config, bindings, FLAG_RELOADABLE); + + + const auto& logConfig = logger::currentConfig(); + if(logConfig) { + logConfig->logfileLevel = (spdlog::level::level_enum) ts::config::log::logfileLevel; + logConfig->terminalLevel = (spdlog::level::level_enum) ts::config::log::terminalLevel; + logger::updateLogLevels(); + } } catch(const YAML::Exception& ex) { errors.emplace_back("Could not read config: " + ex.msg + " @" + to_string(ex.mark.line) + ":" + to_string(ex.mark.column)); return errors; @@ -1007,8 +1016,9 @@ std::deque> config::create_bindings() { { BIND_GROUP(log) { - CREATE_BINDING("level", 0); + CREATE_BINDING("level", FLAG_RELOADABLE); BIND_INTEGRAL(config::log::logfileLevel, spdlog::level::debug, spdlog::level::trace, spdlog::level::off); + ADD_NOTE_RELOADABLE(); ADD_DESCRIPTION("The log level within the log files"); ADD_DESCRIPTION("Available types:"); ADD_DESCRIPTION(" 0: Trace"); @@ -1020,8 +1030,9 @@ std::deque> config::create_bindings() { ADD_DESCRIPTION(" 6: Off"); } { - CREATE_BINDING("terminal_level", 0); + CREATE_BINDING("terminal_level", FLAG_RELOADABLE); BIND_INTEGRAL(config::log::terminalLevel, spdlog::level::info, spdlog::level::trace, spdlog::level::off); + ADD_NOTE_RELOADABLE(); ADD_DESCRIPTION("The log level within the TeaSpeak server terminal"); ADD_DESCRIPTION("Available types:"); ADD_DESCRIPTION(" 0: Trace"); diff --git a/server/src/client/ConnectedClient.cpp b/server/src/client/ConnectedClient.cpp index 62bf627..3465086 100644 --- a/server/src/client/ConnectedClient.cpp +++ b/server/src/client/ConnectedClient.cpp @@ -168,7 +168,7 @@ void ConnectedClient::updateChannelClientProperties(bool lock_channel_tree, bool block_flood = !permission::v2::permission_granted(1, permission_ignore_antiflood); if(server_ref) server_ref->notifyClientPropertyUpdates(_this.lock(), notifyList, notify_self); - this->updateTalkRights(permission_talk_power.has_value ? permission_talk_power.value : 0); + this->updateTalkRights(permission_talk_power); if((this->channels_view_power != permission_channel_view_power || this->channels_ignore_view != permission_channel_ignore_view_power) && notify_self && this->currentChannel && server_ref) { this->channels_view_power = permission_channel_view_power; @@ -197,11 +197,11 @@ void ConnectedClient::updateChannelClientProperties(bool lock_channel_tree, bool } } -void ConnectedClient::updateTalkRights(permission::PermissionValue talk_power) { +void ConnectedClient::updateTalkRights(permission::v2::PermissionFlaggedValue talk_power) { bool flag = false; flag |= this->properties()[property::CLIENT_IS_TALKER].as(); if(!flag && this->currentChannel) { - flag = this->currentChannel->talk_power_granted({talk_power, talk_power != permNotGranted}); + flag = this->currentChannel->talk_power_granted(talk_power); } this->allowedToTalk = flag; } diff --git a/server/src/client/ConnectedClient.h b/server/src/client/ConnectedClient.h index 11ae14b..f927878 100644 --- a/server/src/client/ConnectedClient.h +++ b/server/src/client/ConnectedClient.h @@ -254,7 +254,7 @@ namespace ts { std::shared_ptr request_connection_info(const std::shared_ptr & /* receiver */, bool& /* send temporary (no client response yet) */); virtual void updateChannelClientProperties(bool /* lock channel tree */, bool /* notify our self */); - void updateTalkRights(permission::PermissionValue talk_power); + void updateTalkRights(permission::v2::PermissionFlaggedValue talk_power); virtual std::shared_ptr resolveActiveBan(const std::string& ip_address); diff --git a/server/src/client/command_handler/channel.cpp b/server/src/client/command_handler/channel.cpp index d1208ce..c95c4cd 100644 --- a/server/src/client/command_handler/channel.cpp +++ b/server/src/client/command_handler/channel.cpp @@ -1072,6 +1072,8 @@ command_result ConnectedClient::handleCommandChannelEdit(Command &cmd) { } keys.push_back(&property); } + if(keys.empty()) + return command_result{error::ok}; unique_lock server_channel_w_lock(this->server ? this->server->channel_tree_lock : serverInstance->getChannelTreeLock(), defer_lock); if(require_write_lock) { diff --git a/server/src/client/command_handler/client.cpp b/server/src/client/command_handler/client.cpp index be5d15e..c6285c4 100644 --- a/server/src/client/command_handler/client.cpp +++ b/server/src/client/command_handler/client.cpp @@ -731,7 +731,7 @@ command_result ConnectedClient::handleCommandClientEdit(Command &cmd, const std: ); } if(update_talk_rights) - client->updateTalkRights(client->properties()[property::CLIENT_TALK_POWER]); + client->updateTalkRights(client->calculate_permission(permission::i_client_talk_power, client->getChannelId())); if(this->server) this->server->notifyClientPropertyUpdates(client, updates); diff --git a/server/src/manager/ActionLogger.cpp b/server/src/manager/ActionLogger.cpp index 0874127..4e4702b 100644 --- a/server/src/manager/ActionLogger.cpp +++ b/server/src/manager/ActionLogger.cpp @@ -56,7 +56,6 @@ std::string TypedActionLogger<>::generate_insert(const std::string &table_name, result += ", " + TypedActionLogger::value_binding_name(index); result += ");"; - debugMessage(0, "Insert query: {}", result); return result; } diff --git a/shared b/shared index a4d7c90..b1f5620 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit a4d7c90945525aad35c1280ebfd0d0d8cc7cd197 +Subproject commit b1f5620760351535a825ec3e618150c001b85799