summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_proto.h
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-08-23 18:49:59 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-08-23 18:49:59 +0000
commitdf1139ff3c50f0cffc7dc7a8a4e7310eb7e55e2d (patch)
treeaa69f41aad4783a8411517226f2eee8aa9d52804 /protocols/Tox/src/tox_proto.h
parentb1f4580508e05eee171b6476e90f345414bc8d04 (diff)
Tox:
- fixed own status changing - refactored contacts adding git-svn-id: http://svn.miranda-ng.org/main/trunk@10315 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_proto.h')
-rw-r--r--protocols/Tox/src/tox_proto.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index 243b4625af..1154f58a59 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -107,15 +107,14 @@ private:
INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
- 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 friendnumber, const uint8_t *message, const uint16_t messageSize, void *arg);
- static void OnFriendTyping(Tox *tox, const int friendnumber, uint8_t isTyping, void *arg);
- static void OnFriendNameChange(Tox *tox, const int friendnumber, const uint8_t *name, const uint16_t nameSize, void *arg);
- static void OnStatusMessageChanged(Tox *tox, const int friendnumber, const uint8_t* message, const uint16_t messageSize, void *arg);
- static void OnUserStatusChanged(Tox *tox, int32_t friendnumber, uint8_t usertatus, void *arg);
- static void OnConnectionStatusChanged(Tox *tox, const int friendnumber, const uint8_t status, void *arg);
- static void OnAction(Tox *tox, const int friendnumber, const uint8_t *message, const uint16_t messageSize, void *arg);
- static void OnReadReceipt(Tox *tox, int32_t friendnumber, uint32_t receipt, void *arg);
+ static void OnFriendRequest(Tox *tox, const uint8_t *address, const uint8_t *message, const uint16_t messageSize, void *arg);
+ static void OnFriendMessage(Tox *tox, const int number, const uint8_t *message, const uint16_t messageSize, void *arg);
+ static void OnTypingChanged(Tox *tox, const int number, uint8_t isTyping, void *arg);
+ static void OnFriendNameChange(Tox *tox, const int number, const uint8_t *name, const uint16_t nameSize, void *arg);
+ static void OnStatusMessageChanged(Tox *tox, const int number, const uint8_t* message, const uint16_t messageSize, void *arg);
+ static void OnUserStatusChanged(Tox *tox, int32_t number, uint8_t usertatus, void *arg);
+ static void OnConnectionStatusChanged(Tox *tox, const int number, const uint8_t status, void *arg);
+ static void OnReadReceipt(Tox *tox, int32_t number, uint32_t receipt, void *arg);
// contacts
WORD GetContactStatus(MCONTACT hContact);
@@ -123,8 +122,9 @@ private:
void SetContactStatus(MCONTACT hContact, WORD status);
void SetAllContactsStatus(WORD status);
bool IsProtoContact(MCONTACT hContact);
- MCONTACT FindContact(const char *clientId);
- MCONTACT AddContact(const char *clientId, bool isTemporary = false);
+ MCONTACT FindContact(const std::string &id);
+ MCONTACT FindContact(const int friendNumber);
+ MCONTACT AddContact(const std::string &id, bool isTemporary = false);
MCONTACT GetContactFromAuthEvent(HANDLE hEvent);
@@ -146,6 +146,8 @@ private:
std::vector<uint8_t> HexStringToData(std::string hex);
std::string DataToHexString(std::vector<uint8_t>);
+ std::string ToxAddressToId(std::string);
+
static bool IsFileExists(std::tstring path);
std::tstring GetToxProfilePath();