diff options
author | George Hazan <george.hazan@gmail.com> | 2014-08-05 06:38:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-08-05 06:38:41 +0000 |
commit | 789c9a80befc2e9d0ca02ce8e431f0023adad53c (patch) | |
tree | 59edb92c1e999f879c7bffba68895bc9009c6d18 /plugins/TabSRMM/src | |
parent | 0cefda1f073df2d9170a2b8721ac80f1371a046f (diff) |
use AVS notifications to refresh avatars
git-svn-id: http://svn.miranda-ng.org/main/trunk@10058 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r-- | plugins/TabSRMM/src/infopanel.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 5 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 15 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.h | 1 |
4 files changed, 25 insertions, 0 deletions
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index beb3ddfdd1..4899a93deb 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -1002,6 +1002,10 @@ void CInfoPanel::hideTip(const HWND hwndNew) LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
+ case WM_NOTIFY:
+ ProcessAvatarChange(hwnd, lParam);
+ break;
+
case WM_ERASEBKGND:
/*
* parent window of the infopanel ACC control
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index f3d22f183a..691c89e7e3 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -827,8 +827,13 @@ static LRESULT CALLBACK AvatarSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, L switch (msg) {
case WM_ERASEBKGND:
return TRUE;
+
case WM_UPDATEUISTATE:
return TRUE;
+
+ case WM_NOTIFY:
+ ProcessAvatarChange(hwnd, lParam);
+ break;
}
return mir_callNextSubclass(hwnd, AvatarSubclassProc, msg, wParam, lParam);
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index c208ff6b74..92dc7c6b31 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -530,6 +530,21 @@ void TSAPI HandleIconFeedback(TWindowData *dat, HICON iIcon) }
/////////////////////////////////////////////////////////////////////////////////////////
+// catches notifications from the AVS controls
+
+void TSAPI ProcessAvatarChange(HWND hwnd, LPARAM lParam)
+{
+ if (((LPNMHDR)lParam)->code == NM_AVATAR_CHANGED) {
+ HWND hwndDlg = GetParent(hwnd);
+ TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ if (dat) {
+ GetAvatarVisibility(hwndDlg, dat);
+ SendMessage(hwndDlg, WM_SIZE, 0, 1);
+ }
+ }
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// retrieve the visiblity of the avatar window, depending on the global setting
// and local mode
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index a4addcd2fc..124e7d739c 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -39,6 +39,7 @@ char* TSAPI GetCurrentMetaContactProto(TWindowData *dat); int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID);
int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId);
bool TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat);
+void TSAPI ProcessAvatarChange(HWND hwnd, LPARAM lParam);
void TSAPI UpdateStatusBar(const TWindowData *dat);
int TSAPI CheckValidSmileyPack(const char *szProto, MCONTACT hContact);
TCHAR* TSAPI QuoteText(const TCHAR *text, int charsPerLine, int removeExistingQuotes);
|