diff --git a/server/src/client/command_handler/channel.cpp b/server/src/client/command_handler/channel.cpp index 18cc3b2..30a0324 100644 --- a/server/src/client/command_handler/channel.cpp +++ b/server/src/client/command_handler/channel.cpp @@ -818,8 +818,9 @@ command_result ConnectedClient::handleCommandChannelCreate(Command &cmd) { auto max_channels = this->calculate_permission(permission::i_client_max_channels, parent_channel_id, false); if (max_channels.has_value) { - if (!permission::v2::permission_granted(created_perm + created_semi + created_tmp + 1, max_channels)) + if (!permission::v2::permission_granted(created_perm + created_semi + created_tmp + 1, max_channels)) { return command_result{permission::i_client_max_channels}; + } } if (cmd[0]["channel_flag_permanent"].as()) { @@ -894,6 +895,10 @@ command_result ConnectedClient::handleCommandChannelCreate(Command &cmd) { return ts::command_result{error::vs_critical, "failed to find created channel"}; } + created_channel->properties()[property::CHANNEL_CREATED_BY] = this->getClientDatabaseId(); + created_channel->properties()[property::CHANNEL_CREATED_AT] = + std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + { auto default_modify_power = this->calculate_permission(permission::i_channel_modify_power, parent_channel_id, false); auto default_delete_power = this->calculate_permission(permission::i_channel_delete_power, parent_channel_id, false);