From b5c685fc85feab90ac6fcd7e9423d78c0a83ccb1 Mon Sep 17 00:00:00 2001 From: "Sergey (Elzor) Bolhovskoy" Date: Mon, 5 Apr 2010 22:39:15 +0600 Subject: Fix encoding problems with authorization request and congratulation --- stopspam.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/stopspam.cpp b/stopspam.cpp index 890d559..8ae8d47 100644 --- a/stopspam.cpp +++ b/stopspam.cpp @@ -58,9 +58,16 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_ADDED, wParam, lParam) msg = 0; //is it useful ? } if(msg) - // int a = CallService(allowService.c_str(), (WPARAM)hDbEvent, (LPARAM)(variables_parse(gbAuthRepl, hcntct).c_str())); - CallContactService(hcntct, PSS_MESSAGE, PREF_TCHAR, (LPARAM)(variables_parse(gbAuthRepl, hcntct).c_str())); + { +#ifdef _UNICODE + char * buff=mir_utf8encodeW(variables_parse(gbAuthRepl, hcntct).c_str()); + CallContactService(hcntct, PSS_MESSAGE, PREF_UTF, (LPARAM) buff); + mir_free(buff); +#else + CallContactService(hcntct, PSS_MESSAGE, 0, (LPARAM) variables_parse(gbAuthRepl, hcntct).c_str()); +#endif + }; delete dbei.pBlob; return 1; } @@ -159,7 +166,7 @@ MIRANDA_HOOK_EVENT(ME_DB_EVENT_FILTER_ADD, w, l) { #ifdef _UNICODE char * buf=mir_utf8encodeW(variables_parse(gbCongratulation, hContact).c_str()); - CallContactService(hContact, PSS_MESSAGE, PREF_TCHAR, (LPARAM)buf); + CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)buf); mir_free(buf); #else CallContactService(hContact, PSS_MESSAGE, 0, (LPARAM)GetCongratulation().c_str()); -- cgit v1.2.3