diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-08-10 14:20:09 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-08-10 14:20:09 +0000 |
commit | b3a63d4e727b8552f8cf2b321cc68d2631ef3179 (patch) | |
tree | a533d09af6f41f06a383fb9b703dabc09d7b92d7 /protocols/Tox/src/tox_proto.h | |
parent | 254f7c0601c1972e016e0afb7989b27c9e432239 (diff) |
Tox: refactoring
git-svn-id: http://svn.miranda-ng.org/main/trunk@10144 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_proto.h')
-rw-r--r-- | protocols/Tox/src/tox_proto.h | 22 |
1 files changed, 15 insertions, 7 deletions
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<CToxProto> 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
|