diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-21 16:11:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-21 16:11:58 +0000 |
commit | 48266e479d1fcf5153b29c612866845990fccad8 (patch) | |
tree | c8cbc908cd3c5f08731e5e8d7eaac6b568007d09 /plugins/SecureIM/src/svcs_proto.cpp | |
parent | ebdb556f152734035846f120eb8112f88ef91281 (diff) |
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
Diffstat (limited to 'plugins/SecureIM/src/svcs_proto.cpp')
-rw-r--r-- | plugins/SecureIM/src/svcs_proto.cpp | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/plugins/SecureIM/src/svcs_proto.cpp b/plugins/SecureIM/src/svcs_proto.cpp index 0ebc1de9ed..fb39f770d2 100644 --- a/plugins/SecureIM/src/svcs_proto.cpp +++ b/plugins/SecureIM/src/svcs_proto.cpp @@ -55,32 +55,6 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) Sent_NetLog("onRecvMsg: %s", szEncMsg);
- // cut rtf tags
- if (pRtfconvString && memcmp(szEncMsg, "{\\rtf1", 6) == 0) {
- SAFE_FREE(szUnrtfMsg);
- int len = (int)strlen(szEncMsg) + 1;
- LPWSTR szTemp = (LPWSTR)mir_alloc(len*sizeof(WCHAR));
- if (ppre->flags & PREF_UNICODE)
- rtfconvW((LPWSTR)(szEncMsg + len), szTemp);
- else
- rtfconvA(szEncMsg, szTemp);
- len = (int)wcslen(szTemp) - 1;
- while (len) {
- if (szTemp[len] == 0x0D || szTemp[len] == 0x0A)
- szTemp[len] = 0;
- else
- break;
- len--;
- }
- len = (int)wcslen(&szTemp[1]) + 1;
- szUnrtfMsg = (LPSTR)mir_alloc(len*(sizeof(WCHAR) + 1));
- WideCharToMultiByte(CP_ACP, 0, &szTemp[1], -1, szUnrtfMsg, len*(sizeof(WCHAR) + 1), NULL, NULL);
- memcpy(szUnrtfMsg + len, &szTemp[1], len*sizeof(WCHAR));
- ppre->szMessage = szEncMsg = szUnrtfMsg;
- ppre->flags |= PREF_UNICODE;
- mir_free(szTemp);
- }
-
int ssig = getSecureSig(ppre->szMessage, &szEncMsg);
bool bSecured = (isContactSecured(pccsd->hContact)&SECURED) != 0;
bool bPGP = isContactPGP(pccsd->hContact);
@@ -104,7 +78,7 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) if (ssig == SiG_NONE && !ptr->msgSplitted) {
Sent_NetLog("onRecvMsg: non-secure message");
- ptrA szPlainMsg((ppre->flags & PREF_UNICODE) ? m_awstrcat(Translate(sim402), szEncMsg) : m_aastrcat(Translate(sim402), szEncMsg));
+ ptrA szPlainMsg(m_aastrcat(Translate(sim402), szEncMsg));
ppre->szMessage = szPlainMsg;
pccsd->wParam |= PREF_SIMNOMETA;
return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
@@ -178,8 +152,6 @@ INT_PTR __cdecl onRecvMsg(WPARAM wParam, LPARAM lParam) if (!szOldMsg) { // error while decrypting message, send error
SAFE_FREE(ptr->msgSplitted);
- ppre->flags &= ~(PREF_UNICODE | PREF_UTF);
- pccsd->wParam &= ~(PREF_UNICODE | PREF_UTF);
ppre->szMessage = Translate(sim401);
return CallService(MS_PROTO_CHAINRECV, wParam, lParam);
}
@@ -761,7 +733,6 @@ INT_PTR __cdecl onSendMsg(WPARAM wParam, LPARAM lParam) ptrA keyToSend(InitKeyA(ptr, 0)); // calculate public and private key & fill KeyA
Sent_NetLog("Sending KEY3: %s", keyToSend);
- pccsd->wParam &= ~PREF_UNICODE;
pccsd->wParam |= PREF_METANODB;
pccsd->lParam = (LPARAM)keyToSend;
pccsd->szProtoService = PSS_MESSAGE;
|