From f1c735f22c3f3d6317d86d890ad74d63f0bbf558 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Feb 2016 11:42:00 +0000 Subject: wrong ME_AV_AVATARCHANGED hook could hang popups git-svn-id: http://svn.miranda-ng.org/main/trunk@16260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Popup/src/popup_thread.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'plugins/Popup/src/popup_thread.cpp') diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index af86019a3a..eff60a4523 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -46,7 +46,8 @@ enum UTM_REQUEST_IDLE, UTM_LOCK_QUEUE, UTM_UNLOCK_QUEUE, - UTM_REQUEST_REMOVE + UTM_REQUEST_REMOVE, + UTM_AVATAR_CHANGED }; bool UpdatePopupPosition(PopupWnd2 *prev, PopupWnd2 *wnd) @@ -196,6 +197,13 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA gLockCount = 0; break; + case UTM_AVATAR_CHANGED: + for (int i = 0; i < popupList.getCount(); i++) { + PopupWnd2 *p = popupList[i]; + if (p->getContact() == wParam) + SendMessage(p->getHwnd(), UM_AVATARCHANGED, 0, 0); + } + break; } return DefWindowProc(hwnd, message, wParam, lParam); } @@ -242,10 +250,18 @@ static unsigned __stdcall PopupThread(void *) ///////////////////////////////////////////////////////////////////////////////////////// // interface +static int sttAvatarChanged(WPARAM wParam, LPARAM) +{ + PostMessage(gHwndManager, UTM_AVATAR_CHANGED, wParam, 0); + return 0; +} + void LoadPopupThread() { unsigned threadId; hThread = mir_forkthreadex(PopupThread, NULL, &threadId); + + HookEvent(ME_AV_AVATARCHANGED, sttAvatarChanged); } void StopPopupThread() -- cgit v1.2.3