diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-04-13 11:33:17 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-04-13 11:33:17 +0000 |
commit | 6b1c0b2c99d9ebc1dbb7b7e5e8268af6f911bbff (patch) | |
tree | 6fc243ef701576b65c8f15762b49064cda4ad5ae /protocols/Tox | |
parent | 6647f383bff7d38db530c623caae63d1f50cbc71 (diff) |
Tox: fixed receiving of messages from old api clients
git-svn-id: http://svn.miranda-ng.org/main/trunk@12783 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox')
-rw-r--r-- | protocols/Tox/src/tox_messages.cpp | 9 | ||||
-rw-r--r-- | protocols/Tox/src/version.h | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp index ddcf5fa2f8..afa7c6e445 100644 --- a/protocols/Tox/src/tox_messages.cpp +++ b/protocols/Tox/src/tox_messages.cpp @@ -12,7 +12,14 @@ void CToxProto::OnFriendMessage(Tox*, uint32_t friendNumber, TOX_MESSAGE_TYPE ty return;
char *rawMessage = (char*)mir_alloc(length + 1);
- mir_strncpy(rawMessage, (const char*)message, length);
+ // old api support
+ if (message[0] == 0 && length > 0)
+ {
+ length -= 3;
+ mir_strncpy(rawMessage, (const char*)&message[4], length);
+ }
+ else
+ mir_strncpy(rawMessage, (const char*)message, length);
rawMessage[length] = 0;
PROTORECVEVENT recv = { 0 };
diff --git a/protocols/Tox/src/version.h b/protocols/Tox/src/version.h index d9040b8af6..20350753fa 100644 --- a/protocols/Tox/src/version.h +++ b/protocols/Tox/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 11
#define __RELEASE_NUM 1
-#define __BUILD_NUM 0
+#define __BUILD_NUM 1
#include <stdver.h>
|