summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey (Elzor) Bolhovskoy <elzor@foobar2000.ru>2010-04-05 22:39:15 +0600
committerSergey (Elzor) Bolhovskoy <elzor@foobar2000.ru>2010-04-05 22:39:15 +0600
commitb5c685fc85feab90ac6fcd7e9423d78c0a83ccb1 (patch)
treee1aa83ca8c387f93c90035cc2a8f1e9d44c6fb1a
parentc2dff40cd2902b9dbd017a3505e43516b0b999ca (diff)
Fix encoding problems with authorization request and congratulation
-rw-r--r--stopspam.cpp13
1 files 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());