summaryrefslogtreecommitdiff
path: root/plugins/Popup/src/popup_thread.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-02-10 11:42:00 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-02-10 11:42:00 +0000
commitf1c735f22c3f3d6317d86d890ad74d63f0bbf558 (patch)
tree303cf55f88a028797fe18a1a3db359b6987bdd64 /plugins/Popup/src/popup_thread.cpp
parent4932221e81ccb89f1ac2acde300c1e9efb988f8a (diff)
wrong ME_AV_AVATARCHANGED hook could hang popups
git-svn-id: http://svn.miranda-ng.org/main/trunk@16260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup/src/popup_thread.cpp')
-rw-r--r--plugins/Popup/src/popup_thread.cpp18
1 files changed, 17 insertions, 1 deletions
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()