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 --- plugins/NewAwaySysMod/src/MsgEventAdded.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'plugins/NewAwaySysMod/src') diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp index 61a45f0af6..94b5eb018f 100644 --- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp @@ -58,11 +58,9 @@ void __cdecl AutoreplyDelayThread(void *_ad) return; } - int ReplyLen = (ad->Reply.GetLen() + 1) * (sizeof(char)+sizeof(WCHAR)); - PBYTE pBuf = (PBYTE)_alloca(ReplyLen); - memcpy(pBuf, _T2A(ad->Reply), ad->Reply.GetLen() + 1); - memcpy(pBuf + ad->Reply.GetLen() + 1, ad->Reply, (ad->Reply.GetLen() + 1) * sizeof(WCHAR)); - CallContactService(ad->hContact, ServiceExists(CString(szProto) + PSS_MESSAGE "W") ? (PSS_MESSAGE "W") : PSS_MESSAGE, PREF_UNICODE, (LPARAM)pBuf); + ptrA pszReply(mir_utf8encodeT(ad->Reply)); + int ReplyLen = (int)mir_strlen(pszReply); + CallContactService(ad->hContact, PSS_MESSAGE, 0, (LPARAM)pszReply); if (g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_LOGREPLY)) { // store in the history DBEVENTINFO dbeo = { 0 }; @@ -73,7 +71,7 @@ void __cdecl AutoreplyDelayThread(void *_ad) dbeo.timestamp = time(NULL); dbeo.cbBlob = ReplyLen; - dbeo.pBlob = pBuf; + dbeo.pBlob = (PBYTE)(char*)pszReply; SleepEx(1000, true); // delay before sending the reply, as we need it to be later than the message we're replying to (without this delay, srmm puts the messages in a wrong order) db_event_add(ad->hContact, &dbeo); -- cgit v1.2.3