summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_proto.h
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2017-03-15 00:19:35 +0300
committeraunsane <aunsane@gmail.com>2017-03-15 00:19:35 +0300
commit5de53491d607c38286b19989ba7182454f24fabc (patch)
treecb0da96d057fd1f85245ca3ff3423ea3300da060 /protocols/Tox/src/tox_proto.h
parenta76c706113f6d9e1a1a253feab46051fb2e6ce12 (diff)
Tox:
- tox_network.cpp splitted on two logical parts - tox network status checking moved to separated thread - started rejection of toxThread wrapper
Diffstat (limited to 'protocols/Tox/src/tox_proto.h')
-rw-r--r--protocols/Tox/src/tox_proto.h44
1 files changed, 26 insertions, 18 deletions
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index 953452d01b..dea979efc0 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -72,10 +72,16 @@ private:
CToxThread *toxThread;
mir_cs profileLock;
wchar_t *accountName;
- HANDLE hPollingThread;
+
CTransferList transfers;
ULONG hMessageProcess;
+ bool isTerminated;
+ HANDLE hConnectingThread;
+ HANDLE hCheckingThread;
+ HANDLE hPollingThread;
+ HANDLE hTerminateEvent;
+
static HANDLE hProfileFolderPath;
// tox profile
@@ -83,30 +89,32 @@ private:
static wchar_t* GetToxProfilePath(const wchar_t *accountName);
bool LoadToxProfile(Tox_Options *options);
- void SaveToxProfile(CToxThread *toxThread);
+ void SaveToxProfile(Tox *tox);
INT_PTR __cdecl OnCopyToxID(WPARAM, LPARAM);
// tox core
Tox_Options* GetToxOptions();
- bool InitToxCore(CToxThread *toxThread);
- void UninitToxCore(CToxThread *toxThread);
+ void InitToxCore(Tox *tox);
+ void UninitToxCore(Tox *tox);
- // tox network
- bool IsOnline();
-
- void BootstrapUdpNode(CToxThread *toxThread, const char *address, int port, const char *pubKey);
- void BootstrapTcpRelay(CToxThread *toxThread, const char *address, int port, const char *pubKey);
+ // tox bootstrap
+ void BootstrapUdpNode(Tox *tox, const char *address, int port, const char *pubKey);
+ void BootstrapTcpRelay(Tox *tox, const char *address, int port, const char *pubKey);
- void BootstrapNodesFromDb(CToxThread *toxThread, bool isIPv6);
- void BootstrapNodesFromJson(CToxThread *toxThread, bool isIPv6);
- void BootstrapNodes(CToxThread *toxThread);
+ void BootstrapNodesFromDb(Tox *tox, bool isIPv6);
+ void BootstrapNodesFromJson(Tox *tox, bool isIPv6);
+ void BootstrapNodes(Tox *tox);
void UpdateNodes();
- void TryConnect();
- void CheckConnection(int &retriesCount);
+ // tox connection
+ bool IsOnline();
+
+ void TryConnect(Tox *tox);
+ void CheckConnection(Tox *tox, int &retriesCount);
+ void __cdecl CheckingThread(void*);
void __cdecl PollingThread(void*);
// accounts
@@ -152,10 +160,10 @@ private:
void SetContactStatus(MCONTACT hContact, WORD status);
void SetAllContactsStatus(WORD status);
- MCONTACT GetContact(const int friendNumber);
+ MCONTACT GetContact(const Tox *tox, const int friendNumber);
MCONTACT GetContact(const char *pubKey);
- ToxHexAddress GetContactPublicKey(const int friendNumber);
+ ToxHexAddress GetContactPublicKey(const Tox *tox, const int friendNumber);
MCONTACT AddContact(const char *address, const char *nick = NULL, const char *dnsId = NULL, bool isTemporary = false);
@@ -163,7 +171,7 @@ private:
uint32_t GetToxFriendNumber(MCONTACT hContact);
- void __cdecl LoadFriendList(void*);
+ void LoadFriendList(Tox *tox);
INT_PTR __cdecl OnRequestAuth(WPARAM hContact, LPARAM lParam);
INT_PTR __cdecl OnGrantAuth(WPARAM hContact, LPARAM);
@@ -244,7 +252,7 @@ private:
void PauseOutgoingTransfers(uint32_t friendNumber);
void ResumeIncomingTransfers(uint32_t friendNumber);
- void CancelAllTransfers(CToxThread *toxThread);
+ void CancelAllTransfers(Tox *tox);
// avatars
wchar_t* GetAvatarFilePath(MCONTACT hContact = NULL);