diff options
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 };
|