diff --git a/server/src/client/ConnectedClientCommandHandler.cpp b/server/src/client/ConnectedClientCommandHandler.cpp index af6410e..7e0087a 100644 --- a/server/src/client/ConnectedClientCommandHandler.cpp +++ b/server/src/client/ConnectedClientCommandHandler.cpp @@ -42,8 +42,6 @@ using namespace ts; using namespace ts::server; using namespace ts::token; -extern ts::server::InstanceHandler *serverInstance; - #define QUERY_PASSWORD_LENGTH 12 //TODO: Map permsid! @@ -6512,7 +6510,7 @@ CommandResult ConnectedClient::handleCommandMusicBotCreate(Command& cmd) { shared_lock server_channel_lock(this->server->channel_tree_lock); auto channel = cmd[0].has("cid") ? this->server->channelTree->findChannel(cmd["cid"]) : this->currentChannel; if(!channel) { - if(cmd[0].has("cid")) return {findError("client_invalid_id")}; + if(cmd[0].has("cid")) return {findError("channel_invalid_id")}; } else { CHANNEL_PERMISSION_TEST(permission::i_channel_description_view_power, permission::i_channel_needed_description_view_power, channel, false); auto permission_granted = this->calculate_permission_value(permission::i_channel_join_power, channel->channelId()); @@ -6549,6 +6547,7 @@ CommandResult ConnectedClient::handleCommandMusicBotCreate(Command& cmd) { ); } bot->properties()[property::CLIENT_LAST_CHANNEL] = channel ? channel->channelId() : 0; + bot->properties()[property::CLIENT_COUNTRY] = config::geo::countryFlag; if(permissions[permission::i_client_music_delete_power] > 0) { bot->clientPermissions->set_permission(permission::i_client_music_needed_delete_power, {permissions[permission::i_client_music_delete_power],0}, permission::v2::set_value, permission::v2::do_nothing); @@ -7304,11 +7303,13 @@ CommandResult ConnectedClient::handleCommandHelp(Command& cmd) { auto file = fs::u8path("commanddocs/" + command + ".txt"); if(!fs::exists(file)) return {findError("file_not_found"), "Could not resolve file " + file.string()}; + string line; ifstream stream(file); if(!stream) return {findError("file_io_error"), "Could not read documentation file " + file.string()}; while(getline(stream, line)) - this->sendCommand(Command(line)); + this->sendCommand(Command{line}); + return CommandResult::Success; } diff --git a/server/src/client/music/MusicClientPlayer.cpp b/server/src/client/music/MusicClientPlayer.cpp index eb48394..5982e91 100644 --- a/server/src/client/music/MusicClientPlayer.cpp +++ b/server/src/client/music/MusicClientPlayer.cpp @@ -231,7 +231,7 @@ void MusicClient::forwardSong() { void MusicClient::rewindSong() { this->player_reset(true); - logError(this->getServerId(), "MusicClient::rewindSong hasnt been implemented yet!"); + logError(this->getServerId(), "MusicClient::rewindSong hasn't been implemented yet!"); } void MusicClient::musicEventHandler(const std::weak_ptr& weak_player, ::music::MusicEvent event) { diff --git a/shared b/shared index c532266..ba80cbb 160000 --- a/shared +++ b/shared @@ -1 +1 @@ -Subproject commit c532266cb8b1ba577e063c6ed14a810374c8c84f +Subproject commit ba80cbb229a4a22d9ddcf73a5a0e51bb3600b50d