diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 17:42:08 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 17:42:08 +0000 |
commit | 5975b2d0903bd5df128d55e20cd27d7c13b4e46c (patch) | |
tree | 6696492511c591fa8bf3b65a64864245caa3e7c2 /plugins/NewAwaySysMod/MsgEventAdded.cpp | |
parent | 8617d7e00546f892c9084f7c382648b23d8bbb63 (diff) |
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewAwaySysMod/MsgEventAdded.cpp')
-rw-r--r-- | plugins/NewAwaySysMod/MsgEventAdded.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/plugins/NewAwaySysMod/MsgEventAdded.cpp b/plugins/NewAwaySysMod/MsgEventAdded.cpp index b9bbc80ad2..a8219e7bd7 100644 --- a/plugins/NewAwaySysMod/MsgEventAdded.cpp +++ b/plugins/NewAwaySysMod/MsgEventAdded.cpp @@ -60,15 +60,13 @@ void __cdecl AutoreplyDelayThread(void *_ad) _ASSERT(0);
return;
}
-#ifdef _UNICODE
+
int ReplyLen = (ad->Reply.GetLen() + 1) * (sizeof(char) + sizeof(WCHAR));
PBYTE pBuf = (PBYTE)malloc(ReplyLen);
memcpy(pBuf, TCHAR2ANSI(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);
-#else
- CallContactService(ad->hContact, PSS_MESSAGE, 0, (LPARAM)(char*)ad->Reply);
-#endif
+
if (g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_LOGREPLY))
{ // store in the history
DBEVENTINFO dbeo = {0};
@@ -77,19 +75,16 @@ void __cdecl AutoreplyDelayThread(void *_ad) dbeo.flags = DBEF_SENT;
dbeo.szModule = szProto;
dbeo.timestamp = time(NULL);
-#ifdef _UNICODE
+
dbeo.cbBlob = ReplyLen;
dbeo.pBlob = pBuf;
-#else
- dbeo.cbBlob = ad->Reply.GetLen() + 1;
- dbeo.pBlob = (PBYTE)(char*)ad->Reply;
-#endif
+
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)
CallService(MS_DB_EVENT_ADD, (WPARAM)ad->hContact, (LPARAM)&dbeo);
}
-#ifdef _UNICODE
+
free(pBuf);
-#endif
+
/*
char *utf8Reply = mir_utf8encodeT(ad->Reply); // todo: use this instead of the code above, when 0.7 will be released
if (g_AutoreplyOptPage.GetDBValueCopy(IDC_REPLYDLG_LOGREPLY))
|