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/MSN/src/msn_commands.cpp | 6 ++---- protocols/MSN/src/msn_mail.cpp | 1 - protocols/MSN/src/msn_misc.cpp | 1 - protocols/MSN/src/msn_p2p.cpp | 2 +- protocols/MSN/src/msn_proto.cpp | 19 +++---------------- 5 files changed, 6 insertions(+), 23 deletions(-) (limited to 'protocols/MSN') diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index cddb412fe5..0f3cd8db04 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -244,7 +244,6 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para pre.timestamp = (DWORD)time(NULL); pre.szMessage = (char *)isr; pre.lParam = cnt; - pre.flags = PREF_TCHAR; ProtoChainRecv(hContact, PSR_CONTACTS, 0, (LPARAM)&pre); for (cnt=0; cntemail); @@ -299,7 +298,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para PROTORECVEVENT pre = { 0 }; pre.szMessage = (char*)msgBody; - pre.flags = PREF_UTF + (isRtl ? PREF_RTL : 0); + pre.flags = (isRtl ? PREF_RTL : 0); pre.timestamp = (DWORD)time(NULL); pre.lParam = 0; ProtoChainRecvMsg(hContact, &pre); @@ -1067,7 +1066,6 @@ LBL_InvalidCommand: if (!sentMsg) { PROTORECVEVENT pre = { 0 }; pre.szMessage = (char*)message; - pre.flags = PREF_UTF; pre.timestamp = (DWORD)ts; ProtoChainRecvMsg(hContact, &pre); } @@ -1349,7 +1347,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, mir_sntprintf(tComment, SIZEOF(tComment), TranslateT("%I64u bytes"), ft->std.currentFileSize); PROTORECVFILET pre = { 0 }; - pre.flags = PREF_TCHAR; + pre.dwFlags = PRFF_TCHAR; pre.fileCount = 1; pre.timestamp = time(NULL); pre.tszDescription = tComment; diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 03ab085bc5..77d5d9600c 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -117,7 +117,6 @@ void CMsnProto::getOIMs(ezxml_t xmli) PROTORECVEVENT pre = { 0 }; pre.szMessage = mailInfo.decodeMailBody((char*)mailbody); - pre.flags = PREF_UTF /*+ ((isRtl) ? PREF_RTL : 0)*/; pre.timestamp = evtm; ProtoChainRecvMsg(MSN_HContactFromEmail(szEmail), &pre); mir_free(pre.szMessage); diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 5683bdb389..ff7e203847 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -98,7 +98,6 @@ void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const ch int reasonlen = (int)strlen(reason); PROTORECVEVENT pre = { 0 }; - pre.flags = PREF_UTF; pre.timestamp = (DWORD)time(NULL); pre.lParam = sizeof(DWORD) + sizeof(HANDLE) + nicklen + emaillen + 5 + reasonlen; diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index 8d97c5fa79..06f90bb63b 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -1231,7 +1231,7 @@ void CMsnProto::p2p_InitFileTransfer( mir_sntprintf(tComment, SIZEOF(tComment), TranslateT("%I64u bytes"), ft->std.currentFileSize); PROTORECVFILET pre = { 0 }; - pre.flags = PREF_TCHAR; + pre.dwFlags = PRFF_TCHAR; pre.fileCount = 1; pre.timestamp = time(NULL); pre.tszDescription = tComment; diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 3b9a588261..a49e3bca54 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -659,8 +659,7 @@ DWORD_PTR __cdecl CMsnProto::GetCaps(int type, MCONTACT) return PF2_ONLINE | PF2_SHORTAWAY | PF2_LIGHTDND; case PFLAGNUM_4: - return PF4_FORCEAUTH | PF4_FORCEADDED | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_SUPPORTIDLE | PF4_IMSENDUTF | - PF4_IMSENDOFFLINE | PF4_NOAUTHDENYREASON; + return PF4_FORCEAUTH | PF4_FORCEADDED | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_SUPPORTIDLE | PF4_IMSENDOFFLINE | PF4_NOAUTHDENYREASON; case PFLAGNUM_5: return PF2_ONTHEPHONE; @@ -824,19 +823,8 @@ int __cdecl CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) } char *msg = (char*)pszSrc; - if (msg == NULL) return 0; - - if (flags & PREF_UNICODE) { - char* p = strchr(msg, '\0'); - if (p != msg) { - while (*(++p) == '\0') {} - msg = mir_utf8encodeW((wchar_t*)p); - } - else - msg = mir_strdup(msg); - } - else - msg = (flags & PREF_UTF) ? mir_strdup(msg) : mir_utf8encode(msg); + if (msg == NULL) + return 0; int rtlFlag = (flags & PREF_RTL) ? MSG_RTL : 0; @@ -911,7 +899,6 @@ int __cdecl CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) break; } - mir_free(msg); return seq; } -- cgit v1.2.3