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/AimOscar/src/proto.cpp | 26 ++++---------------------- protocols/AimOscar/src/server.cpp | 5 ++--- 2 files changed, 6 insertions(+), 25 deletions(-) (limited to 'protocols/AimOscar/src') diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index fcf9c2e86b..b3b404cced 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -280,7 +280,7 @@ DWORD_PTR __cdecl CAimProto::GetCaps(int type, MCONTACT) case PFLAGNUM_4: return PF4_SUPPORTTYPING | PF4_FORCEAUTH | PF4_NOCUSTOMAUTH | PF4_FORCEADDED | - PF4_SUPPORTIDLE | PF4_AVATARS | PF4_IMSENDUTF | PF4_IMSENDOFFLINE; + PF4_SUPPORTIDLE | PF4_AVATARS | PF4_IMSENDOFFLINE; case PFLAGNUM_5: return PF2_ONTHEPHONE; @@ -454,7 +454,7 @@ void __cdecl CAimProto::msg_ack_success(void* param) } -int __cdecl CAimProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) +int __cdecl CAimProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) { if (pszSrc == NULL) return 0; @@ -475,31 +475,13 @@ int __cdecl CAimProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) ForkThread(&CAimProto::msg_ack_success, msg_ack); } - char* msg; - if (flags & PREF_UNICODE) - { - const char* p = strchr(pszSrc, '\0'); - if (p != pszSrc) - { - while (*(++p) == '\0'); - } - msg = mir_utf8encodeW((wchar_t*)p); - } - else if (flags & PREF_UTF) - msg = mir_strdup(pszSrc); - else - msg = mir_utf8encode(pszSrc); - - char* smsg = html_encode(msg); - mir_free(msg); - + char *smsg = html_encode(pszSrc), *msg; if (getByte(AIM_KEY_FO, 1)) { msg = bbcodes_to_html(smsg); mir_free(smsg); } - else - msg = smsg; + else msg = smsg; bool blast = getBool(hContact, AIM_KEY_BLS, false); int res = aim_send_message(hServerConn, seqno, sn, msg, false, blast); diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index c7f3e75407..672beff746 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -1277,7 +1277,6 @@ void CAimProto::snac_received_message(SNAC &snac,HANDLE hServerConn,unsigned sho CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hMsgContact, 0); { PROTORECVEVENT pre = { 0 }; - pre.flags = PREF_UTF; pre.timestamp = (is_offline) ? offline_timestamp : (DWORD)time(0); pre.szMessage = msg_buf; ProtoChainRecvMsg(hMsgContact, &pre); @@ -1342,8 +1341,8 @@ void CAimProto::snac_received_message(SNAC &snac,HANDLE hServerConn,unsigned sho TCHAR* filenameT = mir_utf8decodeT(filename); - PROTORECVFILET pre = {0}; - pre.flags = PREF_TCHAR; + PROTORECVFILET pre = { 0 }; + pre.dwFlags = PRFF_TCHAR; pre.fileCount = 1; pre.timestamp = time(NULL); pre.tszDescription = mir_utf8decodeT(msg_buf); -- cgit v1.2.3