diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-09-20 18:57:33 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-09-20 18:57:33 +0000 |
commit | 6c21b8918e51b66845f2555c8e3e4dc7d7a3b749 (patch) | |
tree | 16465c44f8be467404fbe992754e24dd27bf8f86 /protocols/Tox/src/tox_messages.cpp | |
parent | 50445999b29be69be5c9eb0e3fe340d317a0b600 (diff) |
Tox:
- tox id is string again (h8!!)
- updated tox core
git-svn-id: http://svn.miranda-ng.org/main/trunk@10537 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_messages.cpp')
-rw-r--r-- | protocols/Tox/src/tox_messages.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp index ee19016c2d..d22fbc9f2d 100644 --- a/protocols/Tox/src/tox_messages.cpp +++ b/protocols/Tox/src/tox_messages.cpp @@ -35,15 +35,9 @@ void CToxProto::OnFriendAction(Tox *tox, const int number, const uint8_t *action int __cdecl CToxProto::SendMsg(MCONTACT hContact, int flags, const char* msg)
{
- DBVARIANT dbv;
- std::vector<uint8_t> id(TOX_CLIENT_ID_SIZE);
- if (!db_get(hContact, m_szModuleName, TOX_SETTINGS_ID, &dbv))
- {
- memcpy(&id[0], dbv.pbVal, TOX_CLIENT_ID_SIZE);
- db_free(&dbv);
- }
-
- uint32_t number = tox_get_friend_number(tox, id.data());
+ std::string id = getStringA(hContact, TOX_SETTINGS_ID);
+ std::vector<uint8_t> clientId = HexStringToData(id);
+ uint32_t number = tox_get_friend_number(tox, clientId.data());
if (number == TOX_ERROR)
{
debugLogA("CToxProto::SendMsg: failed to get friend number");
@@ -120,14 +114,9 @@ int __cdecl CToxProto::UserIsTyping(MCONTACT hContact, int type) {
if (hContact && IsOnline())
{
- DBVARIANT dbv;
- std::vector<uint8_t> id(TOX_CLIENT_ID_SIZE);
- if (!db_get(hContact, m_szModuleName, TOX_SETTINGS_ID, &dbv))
- {
- memcpy(&id[0], dbv.pbVal, TOX_CLIENT_ID_SIZE);
- db_free(&dbv);
- }
- uint32_t number = tox_get_friend_number(tox, id.data());
+ std::string id = getStringA(hContact, TOX_SETTINGS_ID);
+ std::vector<uint8_t> clientId = HexStringToData(id);
+ uint32_t number = tox_get_friend_number(tox, clientId.data());
if (number >= 0)
{
tox_set_user_is_typing(tox, number, type);
|