From bf23720e7c1d7de70d7d99167a42783f08ef8b17 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 17 Aug 2014 17:26:18 +0000 Subject: Tox: - fixed tox id convertation - fixed tox profile load in first start - fixed polling thread git-svn-id: http://svn.miranda-ng.org/main/trunk@10215 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_proto.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 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 12601b43da..91f6eca7cc 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -10,8 +10,6 @@ CToxProto::CToxProto(const char* protoName, const TCHAR* userName) : SetAllContactsStatus(ID_STATUS_OFFLINE); - hMessageProcess = 1; - // icons wchar_t filePath[MAX_PATH]; GetModuleFileName(g_hInstance, filePath, MAX_PATH); @@ -170,8 +168,6 @@ int __cdecl CToxProto::SendMsg(MCONTACT hContact, int flags, const char* msg) uint32_t number = tox_get_friend_number(tox, clientId.data()); - //ULONG messageId = InterlockedIncrement(&hMessageProcess); - int result = tox_send_message(tox, number, (uint8_t*)msg, strlen(msg)); if (result == 0) { @@ -196,7 +192,7 @@ int __cdecl CToxProto::SetStatus(int iNewStatus) if (iNewStatus == ID_STATUS_OFFLINE) { // logout - isTerminated = true; + isTerminated = isConnected = false; m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE; ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, m_iStatus); @@ -210,11 +206,12 @@ int __cdecl CToxProto::SetStatus(int iNewStatus) } else { - if (old_status == ID_STATUS_OFFLINE/* && !this->IsOnline()*/) + if (old_status == ID_STATUS_OFFLINE && !IsOnline()) { m_iStatus = ID_STATUS_CONNECTING; - connectionThread = ForkThreadEx(&CToxProto::ConnectionThread, 0, NULL); + DoBootstrap(); + hPollingThread = ForkThreadEx(&CToxProto::PollingThread, 0, NULL); } else { -- cgit v1.2.3