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/Sametime/src/sametime_proto.cpp | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'protocols/Sametime/src/sametime_proto.cpp') diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index cacb87a850..c807697ad1 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -131,7 +131,7 @@ DWORD_PTR CSametimeProto::GetCaps(int type, MCONTACT hContact) ret = PF2_ONLINE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_LIGHTDND; break; case PFLAGNUM_4: - ret = PF4_SUPPORTTYPING | PF4_IMSENDUTF; + ret = PF4_SUPPORTTYPING; break; case PFLAG_UNIQUEIDTEXT: ret = (DWORD_PTR)Translate("ID"); @@ -231,9 +231,9 @@ HANDLE CSametimeProto::SendFile(MCONTACT hContact, const PROTOCHAR* szDescriptio return 0; // failure } -int CSametimeProto::SendMsg(MCONTACT hContact, int flags, const char* msg) +int CSametimeProto::SendMsg(MCONTACT hContact, int, const char* msg) { - debugLog(_T("CSametimeProto::SendMsg() hContact=[%x], flags=[%d]"), hContact, flags); + debugLog(_T("CSametimeProto::SendMsg() hContact=[%x]"), hContact); char *proto = GetContactProto(hContact); int ret; @@ -247,19 +247,10 @@ int CSametimeProto::SendMsg(MCONTACT hContact, int flags, const char* msg) return 0; } - char *msg_utf8; - if (flags & PREF_UNICODE) - msg_utf8 = mir_utf8encodeW((wchar_t*)&msg[strlen(msg) + 1]); - else if (flags & PREF_UTF) - msg_utf8 = mir_strdup(msg); - else - msg_utf8 = mir_utf8encode(msg); - - if (!msg_utf8) + if (!msg) return 0; - ret = (int)SendMessageToUser(hContact, msg_utf8); - mir_free(msg_utf8); + ret = (int)SendMessageToUser(hContact, msg); TFakeAckParams *tfap = (TFakeAckParams*)mir_alloc(sizeof(TFakeAckParams)); tfap->proto = this; @@ -305,13 +296,8 @@ int CSametimeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt { debugLog(_T("CSametimeProto::RecvAwayMsg() hContact=[%x], mode=[%d]"), hContact, mode); - if (evt->flags & PREF_UTF) { - TCHAR* pszMsg = mir_utf8decodeT(evt->szMessage); - ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, (LPARAM)pszMsg); - mir_free(pszMsg); - } - else ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, (LPARAM)(TCHAR*)_A2T(evt->szMessage)); - + ptrT pszMsg(mir_utf8decodeT(evt->szMessage)); + ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)evt->lParam, pszMsg); return 0; } -- cgit v1.2.3