comment unused code, dont overwrite source language

This commit is contained in:
Syping 2024-02-10 13:12:50 +01:00
parent 10135e6ec1
commit f74e354901
5 changed files with 10 additions and 1 deletions

View file

@ -82,6 +82,7 @@ std::vector<dpp::snowflake> database::get_channels(dpp::snowflake guild_id)
return {};
}
/*
std::string database::get_channel_source(dpp::snowflake guild_id, dpp::snowflake channel_id)
{
#ifndef NDEBUG
@ -97,6 +98,7 @@ std::vector<bot::settings::target> database::get_channel_targets(dpp::snowflake
#endif
return {};
}
*/
std::vector<dpp::snowflake> database::get_guilds()
{

View file

@ -39,8 +39,10 @@ namespace bot {
virtual std::variant<std::monostate,bot::settings::target> find_channel_target(dpp::snowflake guild_id, dpp::snowflake channel_id, const std::string &target);
virtual bot::settings::channel get_channel(dpp::snowflake guild_id, dpp::snowflake channel_id);
virtual std::vector<dpp::snowflake> get_channels(dpp::snowflake guild_id);
/* unused atm.
virtual std::string get_channel_source(dpp::snowflake guild_id, dpp::snowflake channel_id);
virtual std::vector<bot::settings::target> get_channel_targets(dpp::snowflake guild_id, dpp::snowflake channel_id);
*/
virtual std::vector<dpp::snowflake> get_guilds();
virtual void set_channel_source(dpp::snowflake guild_id, dpp::snowflake channel_id, const std::string &source);
virtual bool sync();

View file

@ -286,6 +286,7 @@ std::vector<dpp::snowflake> file::get_channels(dpp::snowflake guild_id)
return channels;
}
/*
std::string file::get_channel_source(dpp::snowflake guild_id, dpp::snowflake channel_id)
{
const std::lock_guard<std::mutex> guard(m_mutex);
@ -324,6 +325,7 @@ std::vector<bot::settings::target> file::get_channel_targets(dpp::snowflake guil
cache_get_channel(channel_id, &channel);
return channel.targets;
}
*/
std::vector<dpp::snowflake> file::get_guilds()
{

View file

@ -36,8 +36,10 @@ namespace bot {
std::variant<std::monostate,bot::settings::target> find_channel_target(dpp::snowflake guild_id, dpp::snowflake channel_id, const std::string &target) override;
bot::settings::channel get_channel(dpp::snowflake guild_id, dpp::snowflake channel_id) override;
std::vector<dpp::snowflake> get_channels(dpp::snowflake guild_id) override;
/* unused atm.
std::string get_channel_source(dpp::snowflake guild_id, dpp::snowflake channel_id) override;
std::vector<bot::settings::target> get_channel_targets(dpp::snowflake guild_id, dpp::snowflake channel_id) override;
*/
std::vector<dpp::snowflake> get_guilds() override;
void set_channel_source(dpp::snowflake guild_id, dpp::snowflake channel_id, const std::string &source) override;
bool sync() override;

View file

@ -32,6 +32,7 @@ void process_database_channels(std::shared_ptr<bot::database::database> database
for (auto channel = guild->channel.begin(); channel != guild->channel.end(); channel++) {
if (channel->id == *db_channel_id) {
const bot::settings::channel db_channel = database->get_channel(guild->id, channel->id);
if (!db_channel.source.empty())
channel->source = db_channel.source;
for (auto db_target = db_channel.targets.begin(); db_target != db_channel.targets.end(); db_target++) {
bool target_found = false;