From a66281d8453edde56145e032e8d38db91580ba08 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 29 May 2015 21:33:17 +0000 Subject: Tox: - reworked code related with address/public key - added tox_add_tcp_relay to bootstrap - updated tox core - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@13900 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_proto.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'protocols/Tox/src/tox_proto.cpp') diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index 3891400c79..0e7d157c45 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" CToxProto::CToxProto(const char* protoName, const TCHAR* userName) : - PROTO(protoName, userName), - tox(NULL), toxAv(NULL), password(NULL), - isTerminated(false), isConnected(false), - hPollingThread(NULL), hOutDevice(NULL) +PROTO(protoName, userName), +tox(NULL), toxAv(NULL), password(NULL), +isTerminated(false), isConnected(false), +hPollingThread(NULL), hOutDevice(NULL) { InitNetlib(); @@ -70,14 +70,13 @@ MCONTACT CToxProto::AddToList(int flags, PROTOSEARCHRESULT *psr) ShowNotification(TranslateT("You cannot add yourself to your contact list"), 0); return NULL; } - MCONTACT hContact = GetContact((char*)address); - if (hContact) + if (MCONTACT hContact = GetContact((char*)address)) { ShowNotification(TranslateT("Contact already in your contact list"), 0, hContact); return NULL; } - // set tox address as contact public key - return AddContact(address, _T(""), flags & PALF_TEMPORARY); + ptrT dnsId(mir_tstrdup(psr->email)); + return AddContact(address, dnsId, flags & PALF_TEMPORARY); } int CToxProto::Authorize(MEVENT hDbEvent) -- cgit v1.2.3