From ec6783d12fa3d427acabed5460cf343255a77118 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 13 Apr 2015 14:11:47 +0000 Subject: Tox: - fixed contact status changing - fixed messages encoding git-svn-id: http://svn.miranda-ng.org/main/trunk@12784 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_contacts.cpp | 3 +-- protocols/Tox/src/tox_messages.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'protocols') diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 19c7e3c46b..f5d72f8efc 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -303,8 +303,6 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE { if (status != TOX_CONNECTION_NONE) { - proto->SetContactStatus(hContact, ID_STATUS_OFFLINE); - proto->delSetting(hContact, "Auth"); proto->delSetting(hContact, "Grant"); @@ -367,6 +365,7 @@ void CToxProto::OnConnectionStatusChanged(Tox*, uint32_t friendNumber, TOX_CONNE } else { + proto->SetContactStatus(hContact, ID_STATUS_OFFLINE); proto->setDword(hContact, "LastEventDateTS", time(NULL)); for (size_t i = 0; i < proto->transfers.Count(); i++) diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp index afa7c6e445..60de33d5d9 100644 --- a/protocols/Tox/src/tox_messages.cpp +++ b/protocols/Tox/src/tox_messages.cpp @@ -19,7 +19,7 @@ void CToxProto::OnFriendMessage(Tox*, uint32_t friendNumber, TOX_MESSAGE_TYPE ty mir_strncpy(rawMessage, (const char*)&message[4], length); } else - mir_strncpy(rawMessage, (const char*)message, length); + mir_strncpy(rawMessage, (const char*)message, length + 1); rawMessage[length] = 0; PROTORECVEVENT recv = { 0 }; -- cgit v1.2.3