From 78573b079bec4aa315c4e2b87883ef6a1622b221 Mon Sep 17 00:00:00 2001 From: Szymon Tokarz Date: Sun, 12 Jul 2015 22:24:23 +0000 Subject: Tlen protocol - fix encoding in send and receive messages, after commit 11066, tlen has never support PF4_IMSENDUTF git-svn-id: http://svn.miranda-ng.org/main/trunk@14547 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tlen/src/tlen_svc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'protocols/Tlen/src/tlen_svc.cpp') diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index fda51c425e..84755d7291 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -612,18 +612,19 @@ int TlenProtocol::SendMsg(MCONTACT hContact, int, const char* msgRAW) TLEN_LIST_ITEM *item; char msgType[16]; + char* msg = mir_utf8decodeA(msgRAW); int id = TlenSerialNext(this); - if (!mir_strcmp(msgRAW, "")) { + if (!mir_strcmp(msg, "")) { TlenSend(this, "", dbv.pszVal); forkthread(TlenSendMessageAckThread, 0, new SENDACKTHREADDATA(this, hContact, id)); } - else if (!mir_strcmp(msgRAW, "")) { + else if (!mir_strcmp(msg, "")) { TlenSend(this, "", dbv.pszVal, "pic", 0x757f044, id); forkthread(TlenSendMessageAckThread, 0, new SENDACKTHREADDATA(this, hContact, id)); } else { - char *msgEnc = TlenTextEncode(msgRAW); + char *msgEnc = TlenTextEncode(msg); if (msgEnc != NULL) { if (TlenListExist(this, LIST_CHATROOM, dbv.pszVal) && strchr(dbv.pszVal, '/') == NULL) mir_strcpy(msgType, "groupchat"); @@ -651,6 +652,7 @@ int TlenProtocol::SendMsg(MCONTACT hContact, int, const char* msgRAW) mir_free(msgEnc); } + mir_free(msg); db_free(&dbv); return id; } -- cgit v1.2.3