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 /src/core/stdmsg | |
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 'src/core/stdmsg')
-rw-r--r-- | src/core/stdmsg/src/cmdlist.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 38 |
2 files changed, 5 insertions, 35 deletions
diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp index f462ddbb14..4fa38ae9ac 100644 --- a/src/core/stdmsg/src/cmdlist.cpp +++ b/src/core/stdmsg/src/cmdlist.cpp @@ -94,7 +94,7 @@ void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char *sz DBEVENTINFO dbei = { sizeof(dbei) };
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.flags = DBEF_SENT | (p->flags & PREF_UTF ? DBEF_UTF : 0) | (p->flags & PREF_RTL ? DBEF_RTL : 0);
+ dbei.flags = DBEF_SENT | DBEF_UTF | (p->flags & PREF_RTL ? DBEF_RTL : 0);
dbei.szModule = GetContactProto(hContact);
dbei.timestamp = time(0);
dbei.cbBlob = (DWORD)mir_strlen(p->szMsg);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 9e72a86f62..af2c574587 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -53,15 +53,6 @@ static void NotifyLocalWinEvent(MCONTACT hContact, HWND hwnd, unsigned int type) }
}
-static BOOL IsUtfSendAvailable(MCONTACT hContact)
-{
- char *szProto = GetContactProto(hContact);
- if (szProto == NULL)
- return FALSE;
-
- return (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDUTF) ? TRUE : FALSE;
-}
-
static int RTL_Detect(const TCHAR *ptszText)
{
int iLen = (int)_tcslen(ptszText);
@@ -81,34 +72,13 @@ int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char *szProto) return NULL;
int flags = 0;
- int bufSize = 0;
- char *sendBuffer = NULL;
-
if (RTL_Detect(szMsg))
flags |= PREF_RTL;
- if (IsUtfSendAvailable(hContact)) {
- flags |= PREF_UTF;
- sendBuffer = mir_utf8encodeT(szMsg);
- if (!sendBuffer || !sendBuffer[0]) {
- mir_free(sendBuffer);
- return NULL;
- }
- bufSize = (int)strlen(sendBuffer) + 1;
- }
- else {
- flags |= PREF_TCHAR;
- sendBuffer = mir_t2a(szMsg);
- if (!sendBuffer || !sendBuffer[0]) {
- mir_free(sendBuffer);
- return NULL;
- }
- bufSize = (int)strlen(sendBuffer) + 1;
-
- size_t bufSizeT = (_tcslen(szMsg) + 1) * sizeof(TCHAR);
- sendBuffer = (char*)mir_realloc(sendBuffer, bufSizeT + bufSize);
- memcpy((TCHAR*)&sendBuffer[bufSize], szMsg, bufSizeT);
- bufSize += (int)bufSizeT;
+ char *sendBuffer = mir_utf8encodeT(szMsg);
+ if (!sendBuffer || !sendBuffer[0]) {
+ mir_free(sendBuffer);
+ return NULL;
}
if (sendBuffer == NULL)
|