diff --git a/git-teaspeak b/git-teaspeak index 2b3383c..0bcc14c 160000 --- a/git-teaspeak +++ b/git-teaspeak @@ -1 +1 @@ -Subproject commit 2b3383c8419db53b6fe856194e62c38b7a24cd5c +Subproject commit 0bcc14c8eef4febba6e50bf089c84fbbe415bd95 diff --git a/server/src/client/command_handler/channel.cpp b/server/src/client/command_handler/channel.cpp index aa37989..ec5a608 100644 --- a/server/src/client/command_handler/channel.cpp +++ b/server/src/client/command_handler/channel.cpp @@ -642,6 +642,9 @@ command_result ConnectedClient::handleCommandChannelCreate(Command &cmd) { } test_permission(1, permission::b_channel_create_child); } + + new_values[property::CHANNEL_PID] = cmd[key].string(); + continue; } const auto &property = property::find(key); @@ -731,10 +734,10 @@ command_result ConnectedClient::handleCommandChannelCreate(Command &cmd) { auto value = cmd["channel_flag_conversation_private"].as(); if (value) { ACTION_REQUIRES_PERMISSION(permission::b_channel_create_modify_conversation_mode_private, 1, parent_channel_id); - cmd[property::name(property::CHANNEL_CONVERSATION_MODE)] = CHANNELCONVERSATIONMODE_PRIVATE; + new_values[property::CHANNEL_CONVERSATION_MODE] = std::to_string(CHANNELCONVERSATIONMODE_PRIVATE); } else { ACTION_REQUIRES_PERMISSION(permission::b_channel_create_modify_conversation_mode_public, 1, parent_channel_id); - cmd[property::name(property::CHANNEL_CONVERSATION_MODE)] = CHANNELCONVERSATIONMODE_PUBLIC; + new_values[property::CHANNEL_CONVERSATION_MODE] = std::to_string(CHANNELCONVERSATIONMODE_PUBLIC); } continue; } else if (key == "channel_conversation_mode") { @@ -765,6 +768,11 @@ command_result ConnectedClient::handleCommandChannelCreate(Command &cmd) { new_values.emplace((property::ChannelProperties) property.property_index, cmd[key].string()); } + /* Fix since the default value of channel_flag_permanent is 1 which should be zero... */ + if(!new_values.contains(property::CHANNEL_FLAG_PERMANENT)) { + new_values[property::CHANNEL_FLAG_PERMANENT] = std::to_string(false); + } + if (!cmd[0]["channel_flag_permanent"].as() && !this->server) { return command_result{error::parameter_invalid, "You can only create a permanent channel"}; } diff --git a/server/src/client/voice/VoiceClientConnection.cpp b/server/src/client/voice/VoiceClientConnection.cpp index ed260cd..0dbdaa7 100644 --- a/server/src/client/voice/VoiceClientConnection.cpp +++ b/server/src/client/voice/VoiceClientConnection.cpp @@ -177,9 +177,13 @@ void VoiceClientConnection::callback_packet_decoded(void *ptr_this, const ts::pr connection->handlePacketPong(packet); break; + case protocol::INIT1: + /* We've received an init1 packet here. The connection should not send that kind of packets... */ + break; + default: - assert(false); logError(connection->virtual_server_id_, "{} Received hand decoded packet, but we've no method to handle it. Dropping packet.", connection->log_prefix()); + assert(false); break; } } diff --git a/shared b/shared index 5b74992..2ba9288 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit 5b74992beb5f4523485c8a4b6749c7dd6bbf282a +Subproject commit 2ba9288cc29f5be47a6862d5c1c3caec0bb6d377