From 9cbcc4a1234b3ad61110eb733ed8b154f8e3ff68 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Thu, 10 Sep 2015 13:39:26 +0000 Subject: Tox: refactoring git-svn-id: http://svn.miranda-ng.org/main/trunk@15317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_proto.h | 18 +++++++++++------- 1 file changed, 11 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 9b8b2e171c..5c42073af0 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -12,6 +12,8 @@ struct ToxThreadData ToxThreadData() : tox(NULL), toxAv(NULL), isConnected(false), isTerminated(false) { } + + void Stop() { isTerminated = true; } }; struct CToxProto : public PROTO @@ -87,12 +89,13 @@ private: TCHAR *accountName; HANDLE hNetlib, hPollingThread; CTransferList transfers; + CLogger *logger; static HANDLE hProfileFolderPath; // tox profile - std::tstring GetToxProfilePath(); - static std::tstring CToxProto::GetToxProfilePath(const TCHAR *accountName); + TCHAR* GetToxProfilePath(); + static TCHAR* CToxProto::GetToxProfilePath(const TCHAR *accountName); bool LoadToxProfile(Tox_Options *options); void SaveToxProfile(); @@ -250,8 +253,8 @@ private: void ResumeIncomingTransfers(uint32_t friendNumber); // avatars - std::tstring GetAvatarFilePath(MCONTACT hContact = NULL); - void SetToxAvatar(std::tstring path); + TCHAR* GetAvatarFilePath(MCONTACT hContact = NULL); + void SetToxAvatar(const TCHAR* path); INT_PTR __cdecl GetAvatarCaps(WPARAM wParam, LPARAM lParam); INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM lParam); @@ -283,15 +286,16 @@ private: static void OnAvPeerTimeout(void*, int32_t callId, void *arg); // utils - TOX_USER_STATUS MirandaToToxStatus(int status); - int ToxToMirandaStatus(TOX_USER_STATUS userstatus); + static int MapStatus(int status); + static TOX_USER_STATUS MirandaToToxStatus(int status); + static int ToxToMirandaStatus(TOX_USER_STATUS userstatus); static TCHAR* ToxErrorToString(TOX_ERR_NEW error); static void ShowNotification(const TCHAR *message, int flags = 0, MCONTACT hContact = NULL); static void ShowNotification(const TCHAR *caption, const TCHAR *message, int flags = 0, MCONTACT hContact = NULL); - static bool IsFileExists(std::tstring path); + static bool IsFileExists(const TCHAR* path); MEVENT AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, PBYTE pBlob, size_t cbBlob); -- cgit v1.2.3