diff --git a/src/toxdns.cpp b/src/toxdns.cpp index 1a5e3b0c5..cd6a3e1fb 100644 --- a/src/toxdns.cpp +++ b/src/toxdns.cpp @@ -219,6 +219,11 @@ fallbackOnTox1: tox_dns3_kill(tox_dns3); #if TOX1_SILENT_FALLBACK toxIdStr = queryTox1(record, silent); +#elif TOX1_ASK_FALLBACK + QMessageBox::StandardButton btn = QMessageBox::warning(nullptr, "qTox", tr("qTox needs to use the old tox1 protocol.\n\ +But tox1 is insecure and doesn't protect metadata. Should we use it anyway ?"), QMessageBox::Ok|QMessageBox::No, QMessageBox::No); + if (btn == QMessageBox::Ok) + queryTox1(record, silent); #endif return toxIdStr; } @@ -258,6 +263,11 @@ ToxID ToxDNS::resolveToxAddress(const QString &address, bool silent) { #if TOX1_SILENT_FALLBACK toxId = ToxID::fromString(queryTox1(address, silent)); +#elif TOX1_ASK_FALLBACK + QMessageBox::StandardButton btn = QMessageBox::warning(nullptr, "qTox", tr("qTox needs to use the old tox1 protocol.\n\ +But tox1 is insecure and doesn't protect metadata. Should we use it anyway ?"), QMessageBox::Ok|QMessageBox::No, QMessageBox::No); + if (btn == QMessageBox::Ok) + toxId = ToxID::fromString(queryTox1(address, silent)); #else return toxId; #endif diff --git a/src/toxdns.h b/src/toxdns.h index a7a644041..91b907d5a 100644 --- a/src/toxdns.h +++ b/src/toxdns.h @@ -25,6 +25,9 @@ /// Tox1 is not encrypted, it's unsafe #define TOX1_SILENT_FALLBACK 0 +/// That said if the user insists ... +#define TOX1_ASK_FALLBACK 1 + /// Handles tox1 and tox3 DNS queries class ToxDNS : public QObject {