summaryrefslogtreecommitdiff
path: root/tipper/popwin.cpp
diff options
context:
space:
mode:
author(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2012-03-06 10:13:13 +0000
committer(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2012-03-06 10:13:13 +0000
commitfa3cdddd7fa6c0b50b117709da605a524e36117a (patch)
treed5c313121131c85cd1cdfa99298795736edb9a7b /tipper/popwin.cpp
parentbee94b5c80be73abd32db65d68d7acaaf5738883 (diff)
Compatibility with Unicode avatars
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@597 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'tipper/popwin.cpp')
-rw-r--r--tipper/popwin.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/tipper/popwin.cpp b/tipper/popwin.cpp
index d0cbf4f..79f6f17 100644
--- a/tipper/popwin.cpp
+++ b/tipper/popwin.cpp
@@ -262,7 +262,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
PROTO_AVATAR_INFORMATION AI = {0};
AI.cbSize = sizeof(AI);
AI.hContact = pwd->hContact;
- CallService(svc, (WPARAM)GAIF_FORCE, (LPARAM)&AI);
+ CallService(svc, 0, (LPARAM)&AI);
}
SendMessage(hwnd, PUM_REFRESH_VALUES, 0, 0);
}
@@ -574,7 +574,6 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
if(pwd->rows) free(pwd->rows);
- if(pwd->hBm) DeleteObject(pwd->hBm);
free(pwd); pwd = 0;
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
}
@@ -730,25 +729,24 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// avatar height
pwd->av_height = 0;
- if(!pwd->text_tip && options.av_layout != PAV_NONE && ServiceExists(MS_AV_DRAWAVATAR)) {
+ if (!pwd->text_tip && options.av_layout != PAV_NONE && ServiceExists(MS_AV_DRAWAVATAR))
+ {
AVATARCACHEENTRY *ace = 0;
- if(pwd->hContact) ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)pwd->hContact, 0);
+ if (pwd->hContact) ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)pwd->hContact, 0);
else ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)pwd->clcit.proto);
- if(ace && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST)) {
- if(pwd->hBm) DeleteObject(pwd->hBm);
- pwd->hBm = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)ace->szFilename);
- BITMAP bm;
- GetObject(pwd->hBm, sizeof(bm), &bm);
- if(options.no_resize_av || (bm.bmHeight <= options.av_size && bm.bmWidth <= options.av_size)) {
- pwd->real_av_width = bm.bmWidth;
- pwd->real_av_height = bm.bmHeight;
+ if (ace && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST))
+ {
+ pwd->hBm = ace->hbmPic;
+ if (options.no_resize_av || (ace->bmHeight <= options.av_size && ace->bmWidth <= options.av_size)) {
+ pwd->real_av_width = ace->bmWidth;
+ pwd->real_av_height = ace->bmHeight;
} else {
- if(bm.bmHeight >= bm.bmWidth) {
+ if (ace->bmHeight >= ace->bmWidth) {
pwd->real_av_height = options.av_size;
- pwd->real_av_width = (int)(options.av_size * (bm.bmWidth / (double)bm.bmHeight));
+ pwd->real_av_width = options.av_size * ace->bmWidth / ace->bmHeight;
} else {
- pwd->real_av_height = (int)(options.av_size * (bm.bmHeight / (double)bm.bmWidth));
+ pwd->real_av_height = options.av_size * ace->bmHeight / ace->bmWidth;
pwd->real_av_width = options.av_size;
}
}