From 5975b2d0903bd5df128d55e20cd27d7c13b4e46c Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Sat, 16 Jun 2012 17:42:08 +0000 Subject: another portion of "#ifdef Unicode" removal git-svn-id: http://svn.miranda-ng.org/main/trunk@448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewAwaySysMod/AwaySys.cpp | 8 ++++---- plugins/NewAwaySysMod/Common.h | 7 ++----- plugins/NewAwaySysMod/MsgEventAdded.cpp | 17 ++++++----------- 3 files changed, 12 insertions(+), 20 deletions(-) (limited to 'plugins/NewAwaySysMod') diff --git a/plugins/NewAwaySysMod/AwaySys.cpp b/plugins/NewAwaySysMod/AwaySys.cpp index 0e10dd9eeb..1e968393b9 100644 --- a/plugins/NewAwaySysMod/AwaySys.cpp +++ b/plugins/NewAwaySysMod/AwaySys.cpp @@ -980,15 +980,15 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam) update.pbVersion = (BYTE*)CreateVersionString(my_make_version(PRODUCTVER), szVersion); update.cpbVersion = strlen((char*)update.pbVersion); update.szUpdateURL = "http://myied.org/packs/NAS" -#ifdef _UNICODE + "W" -#endif + ".zip"; update.szVersionURL = "http://myied.org/packs/NAS/updaterinfo.php"; update.pbVersionPrefix = (BYTE*)"New Away System Mod" -#ifdef _UNICODE + " Unicode" -#endif + " version "; update.cpbVersionPrefix = strlen((char*)update.pbVersionPrefix); CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); diff --git a/plugins/NewAwaySysMod/Common.h b/plugins/NewAwaySysMod/Common.h index a76012036f..7801d3f47e 100644 --- a/plugins/NewAwaySysMod/Common.h +++ b/plugins/NewAwaySysMod/Common.h @@ -290,7 +290,7 @@ typedef struct #define MTYPE_AUTOONLINE 0xE7 // required to support ICQ Plus online status messages /* // additional m_popup.h declarations -#ifdef _UNICODE + typedef struct { HANDLE lchContact; @@ -306,10 +306,7 @@ typedef struct } POPUPDATAT; #define MS_POPUP_ADDPOPUPT MS_POPUP_ADDPOPUPW -#else - #define POPUPDATAT POPUPDATAEX - #define MS_POPUP_ADDPOPUPT MS_POPUP_ADDPOPUPEX -#endif + */ // Beware of conflicts between two different windows trying to use the same page at a time! // Other windows than the owner of the Page must copy the page to their own memory, 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)) -- cgit v1.2.3