From 698fd069729fae17fc4f845f568ac327eb86fab3 Mon Sep 17 00:00:00 2001 From: Diadlo Date: Wed, 30 Dec 2015 23:00:20 +0300 Subject: [PATCH] Add Toxme lookup support qTox will try Toxme, and if Toxme not supported, ToxDNS --- src/widget/form/addfriendform.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/widget/form/addfriendform.cpp b/src/widget/form/addfriendform.cpp index b55aa8389..35a14a8fe 100644 --- a/src/widget/form/addfriendform.cpp +++ b/src/widget/form/addfriendform.cpp @@ -128,14 +128,16 @@ Ignore the proxy and connect to the Internet directly?"), QMessageBox::Yes|QMess return; } - ToxId toxId = ToxDNS::resolveToxAddress(id, true); - - if (toxId.toString().isEmpty()) + ToxId toxId = Toxme::lookup(id); // Try Toxme + if (toxId.toString().isEmpty()) // If it isn't supported { - GUI::showWarning(tr("Couldn't add friend"), tr("This Tox ID does not exist","DNS error")); - return; + toxId = ToxDNS::resolveToxAddress(id, true); // Use ToxDNS + if (toxId.toString().isEmpty()) + { + GUI::showWarning(tr("Couldn't add friend"), tr("This Tox ID does not exist","DNS error")); + return; + } } - emit friendRequested(toxId.toString(), getMessage()); this->toxId.clear(); this->message.clear();