Fix Embed Construction Order

This commit is contained in:
Salanto 2021-08-19 23:01:12 +02:00
parent ce660b56de
commit 20a9112a21
3 changed files with 7 additions and 5 deletions

View File

@ -217,7 +217,7 @@ class ConfigManager {
* *
* @return See short description. * @return See short description.
*/ */
static QString discordWebhookContent(); static QString discordModcallWebhookContent();
/** /**
* @brief Returns true if the discord webhook should send log files. * @brief Returns true if the discord webhook should send log files.

View File

@ -17,6 +17,8 @@
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
#include "include/config_manager.h" #include "include/config_manager.h"
#include <include/config_manager.h>
QSettings* ConfigManager::m_settings = new QSettings("config/config.ini", QSettings::IniFormat); QSettings* ConfigManager::m_settings = new QSettings("config/config.ini", QSettings::IniFormat);
QSettings* ConfigManager::m_discord = new QSettings("config/discord.ini", QSettings::IniFormat); QSettings* ConfigManager::m_discord = new QSettings("config/discord.ini", QSettings::IniFormat);
ConfigManager::CommandSettings* ConfigManager::m_commands = new CommandSettings(); ConfigManager::CommandSettings* ConfigManager::m_commands = new CommandSettings();
@ -285,9 +287,9 @@ QString ConfigManager::discordModcallWebhookUrl()
return m_discord->value("Discord/webhook_modcall_url", "").toString(); return m_discord->value("Discord/webhook_modcall_url", "").toString();
} }
QString ConfigManager::discordWebhookContent() QString ConfigManager::discordModcallWebhookContent()
{ {
return m_discord->value("Discord/webhook_content", "").toString(); return m_discord->value("Discord/webhook_modcall_content", "").toString();
} }
bool ConfigManager::discordModcallWebhookSendFile() bool ConfigManager::discordModcallWebhookSendFile()

View File

@ -71,9 +71,9 @@ QJsonDocument Discord::constructModcallJson(const QString &f_name, const QString
{"description", f_reason} {"description", f_reason}
}; };
l_array.append(l_object); l_array.append(l_object);
l_json["content"] = ConfigManager::discordModcallWebhookContent();
l_json["embeds"] = l_array; l_json["embeds"] = l_array;
if (!ConfigManager::discordWebhookContent().isEmpty())
l_json["content"] = ConfigManager::discordWebhookContent();
return QJsonDocument(l_json); return QJsonDocument(l_json);
} }