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/src/tox_messages.cpp | |
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/src/tox_messages.cpp')
-rw-r--r-- | protocols/Tox/src/tox_messages.cpp | 9 |
1 files changed, 8 insertions, 1 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 };
|