From b3a63d4e727b8552f8cf2b321cc68d2631ef3179 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 10 Aug 2014 14:20:09 +0000 Subject: Tox: refactoring git-svn-id: http://svn.miranda-ng.org/main/trunk@10144 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_proto.h | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'protocols/Tox/src/tox_proto.h') diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index bd40afd4e4..49f8a6c131 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -73,19 +73,23 @@ public: private: Tox *tox; mir_cs tox_lock; + HANDLE connectionThread; HANDLE poolingThread; bool isTerminated; + bool isConnected; // instances static LIST instanceList; static int CompareProtos(const CToxProto *p1, const CToxProto *p2); - //services - INT_PTR __cdecl CreateAccMgrUI(WPARAM, LPARAM); - - //events + // account + void DoBootstrap(); + void DoTox(); + + void __cdecl ConnectionThread(void*); void __cdecl PollingThread(void*); + //events static void OnFriendRequest(Tox *tox, const uint8_t *userId, const uint8_t *message, const uint16_t messageSize, void *arg); static void OnFriendMessage(Tox *tox, const int friendId, const uint8_t *message, const uint16_t messageSize, void *arg); static void OnFriendNameChange(Tox *tox, const int friendId, const uint8_t *name, const uint16_t nameSize, void *arg); @@ -97,13 +101,17 @@ private: // contacts bool IsProtoContact(MCONTACT hContact); MCONTACT GetContactByUserId(const wchar_t *userId); - MCONTACT CToxProto::AddContact(const wchar_t*userId, const wchar_t *nick, bool isHidden = false); + MCONTACT AddContact(const wchar_t*userId, const wchar_t *nick, bool isHidden = false); void __cdecl SearchByUidAsync(void* arg); + //services + INT_PTR __cdecl CreateAccMgrUI(WPARAM, LPARAM); + // utils - char *HexToBinString(const char *hex_string); - char *BinToHexString(uint8_t *bin_string); + TOX_USERSTATUS MirandaToToxStatus(int status); + uint8_t *HexStringToData(const char *hex_string); + char *DataToHexString(const uint8_t *bin_string); void do_bootstrap(Tox *tox); // dialogs -- cgit v1.2.3