From 48266e479d1fcf5153b29c612866845990fccad8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 21 May 2015 16:11:58 +0000 Subject: war against atavisms continues - everything that goes to PSS_MESSAGE should be sent as utf8 string; - thus PREF_UNICODE & PREF_UTF support discontinued, these constants are removed; - support for PREF_UNICODE & PREF_UTF in protocols also removed; - PREF_UNICODE used in file transfers (PROTOFILERECVT) replaced with PRFF_UNICODE / PRFF_TCHAR git-svn-id: http://svn.miranda-ng.org/main/trunk@13734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tlen/src/tlen_svc.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 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 96e20cdc21..9481729dd8 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -601,7 +601,7 @@ INT_PTR TlenProtocol::SendAlert(WPARAM hContact, LPARAM lParam) return 0; } -int TlenProtocol::SendMsg(MCONTACT hContact, int flags, const char* msgRAW) +int TlenProtocol::SendMsg(MCONTACT hContact, int, const char* msgRAW) { DBVARIANT dbv; if (!isOnline || db_get(hContact, m_szModuleName, "jid", &dbv)) { @@ -609,30 +609,21 @@ int TlenProtocol::SendMsg(MCONTACT hContact, int flags, const char* msgRAW) return 2; } - char* msg; - if (flags & PREF_UNICODE) - msg = mir_u2a((wchar_t*)&msgRAW[strlen(msgRAW) + 1]); - else if (flags & PREF_UTF) - msg = mir_utf8decodeA(msgRAW); - else - msg = mir_strdup(msgRAW); - TLEN_LIST_ITEM *item; char msgType[16]; - int id = TlenSerialNext(this); - if (!strcmp(msg, "")) { + if (!strcmp(msgRAW, "")) { TlenSend(this, "", dbv.pszVal); forkthread(TlenSendMessageAckThread, 0, new SENDACKTHREADDATA(this, hContact, id)); } - else if (!strcmp(msg, "")) { + else if (!strcmp(msgRAW, "")) { TlenSend(this, "", dbv.pszVal, "pic", 0x757f044, id); forkthread(TlenSendMessageAckThread, 0, new SENDACKTHREADDATA(this, hContact, id)); } else { - char *msgEnc=TlenTextEncode(msg); + char *msgEnc = TlenTextEncode(msgRAW); if (msgEnc != NULL) { if (TlenListExist(this, LIST_CHATROOM, dbv.pszVal) && strchr(dbv.pszVal, '/') == NULL) strcpy(msgType, "groupchat"); @@ -660,7 +651,6 @@ int TlenProtocol::SendMsg(MCONTACT hContact, int flags, const char* msgRAW) mir_free(msgEnc); } - mir_free(msg); db_free(&dbv); return id; } -- cgit v1.2.3