summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-08 22:46:18 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-08 22:46:18 +0300
commit92f80d349f63f694d0fdcf003a852fd424557663 (patch)
treec3c65e956949cdd294c4fce32f696e1c811ec7de /plugins/UserInfoEx/src
parent82a3bbaf034bc286665465d8904e6d1db52e5eb4 (diff)
unused ansi services removed
Diffstat (limited to 'plugins/UserInfoEx/src')
-rw-r--r--plugins/UserInfoEx/src/svc_avatar.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/UserInfoEx/src/svc_avatar.cpp b/plugins/UserInfoEx/src/svc_avatar.cpp
index bf510a731b..48a619d79d 100644
--- a/plugins/UserInfoEx/src/svc_avatar.cpp
+++ b/plugins/UserInfoEx/src/svc_avatar.cpp
@@ -27,16 +27,13 @@ namespace NServices
{
static HANDLE ghChangedHook = NULL;
- static int GetContactAvatarFileName(LPCTSTR zodiac, LPSTR szFileName, int cchFileName)
+ static int GetContactAvatarFileName(LPCWSTR zodiac, LPWSTR szFileName, int cchFileName)
{
- if (!Profile_GetPathA(cchFileName, szFileName)) {
- size_t len = mir_strlen(szFileName);
+ if (!Profile_GetPathW(cchFileName, szFileName)) {
+ size_t len = mir_wstrlen(szFileName);
+ mir_snwprintf(szFileName + len, cchFileName - len, L"\\avatars\\%s.png", zodiac);
- CHAR tmp[64];
- if (WideCharToMultiByte(CP_ACP, 0, zodiac, 64, tmp, _countof(tmp), 0, 0) > 0)
- mir_snprintf(szFileName + len, cchFileName - len, "\\avatars\\%s.png", tmp);
-
- return !PathFileExistsA(szFileName);
+ return !PathFileExistsW(szFileName);
}
return 1;
}
@@ -49,7 +46,7 @@ namespace NServices
if (!mtb.DBGetBirthDate(hContact)) {
MZodiac zodiac;
//ICONINFO iinfo;
- CHAR szFileName[MAX_PATH];
+ WCHAR szFileName[MAX_PATH];
// get zodiac for birthday
zodiac = mtb.Zodiac();
@@ -59,7 +56,7 @@ namespace NServices
//GetIconInfo(zodiac.hIcon, &iinfo);
// save the bitmap to a file used as avatar later
- if (!CallService(MS_AV_SETAVATAR, hContact, (LPARAM)szFileName))
+ if (!CallService(MS_AV_SETAVATARW, hContact, (LPARAM)szFileName))
db_set_b(hContact, "ContactPhoto", "IsZodiac", 1);
}
}