diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-30 16:41:33 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-30 16:41:33 +0000 |
commit | 87b6a1ccf47c706cd3d8f5aecf72e894b9e53d25 (patch) | |
tree | 1df3a4518ada2f8e14a4452b36ab231569ad2e9f /plugins/TabSRMM/src/msgs.cpp | |
parent | 68f97aff23dca4f9a93b5c67a31cf86754216b2f (diff) |
*sigh* this shitty handler is still required...
git-svn-id: http://svn.miranda-ng.org/main/trunk@9995 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/msgs.cpp')
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 9225b1d489..a53fb2baca 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -370,6 +370,42 @@ int SplitmsgShutdown(void) return 0; } +int AvatarChanged(WPARAM wParam, LPARAM lParam) +{ + if (wParam == 0) { // protocol picture has changed... + M.BroadcastMessage(DM_PROTOAVATARCHANGED, wParam, lParam); + return 0; + } + + HWND hwnd = M.FindWindow(wParam); + if (hwnd == NULL) + return 0; + + TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + if (dat == NULL) + return 0; + + avatarCacheEntry *ace = (avatarCacheEntry *)lParam; + dat->ace = ace; + if (dat->hTaskbarIcon) + DestroyIcon(dat->hTaskbarIcon); + dat->hTaskbarIcon = 0; + DM_RecalcPictureSize(dat); + if (!dat->bShowAvatar || !dat->bShowInfoAvatar) + GetAvatarVisibility(hwnd, dat); + if (dat->hwndPanelPic) { + dat->panelWidth = -1; // force new size calculations (not for flash avatars) + SendMessage(dat->hwnd, WM_SIZE, 0, 1); + } + dat->panelWidth = -1; // force new size calculations (not for flash avatars) + RedrawWindow(dat->hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN); + SendMessage(dat->hwnd, WM_SIZE, 0, 1); + ShowPicture(dat, TRUE); + dat->dwFlagsEx |= MWF_EX_AVATARCHANGED; + dat->pContainer->SideBar->updateSession(dat); + return 0; +} + int MyAvatarChanged(WPARAM wParam, LPARAM lParam) { if (wParam == 0 || IsBadReadPtr((void*)wParam, 4)) |