diff options
| author | Cerapter <cerap@protonmail.com> | 2018-08-19 09:18:35 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-08-19 09:18:35 +0200 |
| commit | 7de64bd0c085216e7c88e15860d4e34cd79e6586 (patch) | |
| tree | 9dde8a57600763f31e594f72fab71c30668e8861 | |
| parent | 95b8bd72d3aa870c829fb3176a66cc1976a1762d (diff) | |
Discord toggle pt.2.
Forgot these.
| -rw-r--r-- | packet_distribution.cpp | 3 | ||||
| -rw-r--r-- | text_file_functions.cpp | 7 |
2 files changed, 7 insertions, 3 deletions
diff --git a/packet_distribution.cpp b/packet_distribution.cpp index f98417dc..abc5848c 100644 --- a/packet_distribution.cpp +++ b/packet_distribution.cpp @@ -265,7 +265,8 @@ void AOApplication::server_packet_received(AOPacket *p_packet) QCryptographicHash hash(QCryptographicHash::Algorithm::Sha256); 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") { diff --git a/text_file_functions.cpp b/text_file_functions.cpp index aa14068e..c784d1f6 100644 --- a/text_file_functions.cpp +++ b/text_file_functions.cpp @@ -586,8 +586,11 @@ bool AOApplication::get_blank_blip() return result.startsWith("true"); } - - +bool AOApplication::is_discord_enabled() +{ + QString result = configini->value("discord", "true").value<QString>(); + return result.startsWith("true"); +} |
