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 | |
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')
-rw-r--r-- | plugins/TabSRMM/src/functions.h | 1 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 1 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 36 |
3 files changed, 38 insertions, 0 deletions
diff --git a/plugins/TabSRMM/src/functions.h b/plugins/TabSRMM/src/functions.h index e9ea3c884a..c494f33dc2 100644 --- a/plugins/TabSRMM/src/functions.h +++ b/plugins/TabSRMM/src/functions.h @@ -33,6 +33,7 @@ #ifndef _TABSRMM_FUNCTIONS_H
#define _TABSRMM_FUNCTIONS_H
+int AvatarChanged(WPARAM wParam, LPARAM lParam); int MyAvatarChanged(WPARAM wParam, LPARAM lParam);
int IconsChanged(WPARAM wParam, LPARAM lParam);
int IcoLibIconsChanged(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 19df91547a..54d0b9da6c 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -271,6 +271,7 @@ void CGlobals::hookSystemEvents() HookEvent(ME_SKIN2_ICONSCHANGED, ::IcoLibIconsChanged);
HookEvent(ME_AV_MYAVATARCHANGED, ::MyAvatarChanged);
+ HookEvent(ME_AV_AVATARCHANGED, ::AvatarChanged);
}
int CGlobals::TopToolbarLoaded(WPARAM,LPARAM)
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)) |