Discord toggle pt.2.

Forgot these.
This commit is contained in:
Cerapter 2018-08-19 09:18:35 +02:00
parent 95b8bd72d3
commit 7de64bd0c0
2 changed files with 7 additions and 3 deletions

View File

@ -265,7 +265,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
QCryptographicHash hash(QCryptographicHash::Algorithm::Sha256); QCryptographicHash hash(QCryptographicHash::Algorithm::Sha256);
hash.addData(server_address.toUtf8()); hash.addData(server_address.toUtf8());
discord->state_server(server_name.toStdString(), hash.result().toBase64().toStdString()); if (is_discord_enabled())
discord->state_server(server_name.toStdString(), hash.result().toBase64().toStdString());
} }
else if (header == "CI") else if (header == "CI")
{ {

View File

@ -586,8 +586,11 @@ bool AOApplication::get_blank_blip()
return result.startsWith("true"); return result.startsWith("true");
} }
bool AOApplication::is_discord_enabled()
{
QString result = configini->value("discord", "true").value<QString>();
return result.startsWith("true");
}