From 7de64bd0c085216e7c88e15860d4e34cd79e6586 Mon Sep 17 00:00:00 2001 From: Cerapter Date: Sun, 19 Aug 2018 09:18:35 +0200 Subject: [PATCH] Discord toggle pt.2. Forgot these. --- packet_distribution.cpp | 3 ++- text_file_functions.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packet_distribution.cpp b/packet_distribution.cpp index f98417d..abc5848 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 aa14068..c784d1f 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(); + return result.startsWith("true"); +}