diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-24 17:01:43 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-24 17:01:43 +0000 |
commit | ac577d016e763053b35393611441bf8cade5d550 (patch) | |
tree | 215284805854de6e7a777ac161bc7cf536214b1a | |
parent | a8fd33c7efd6f25fb6127467ad6547bd8e9c995a (diff) |
tabSRMM has to set the sub's contact manually to display correct avatar
git-svn-id: http://svn.miranda-ng.org/main/trunk@9932 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/utils.cpp | 14 | ||||
-rw-r--r-- | plugins/TabSRMM/src/utils.h | 1 | ||||
-rw-r--r-- | plugins/TabSRMM/src/version.h | 2 |
4 files changed, 17 insertions, 8 deletions
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 6148967df9..1a57ec482b 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -641,7 +641,7 @@ int TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat) if (dat->showInfoPic) {
// panel and contact is shown, reloads contact's avatar -> panel
// user avatar -> bottom picture
- SendMessage(dat->hwndPanelPic, AVATAR_SETCONTACT, 0, (LPARAM)dat->hContact);
+ Utils::setAvatarContact(dat->hwndPanelPic, dat->hContact);
if (dat->hwndContactPic)
SendMessage(dat->hwndContactPic, AVATAR_SETPROTOCOL, 0, (LPARAM)dat->szProto);
}
@@ -699,7 +699,7 @@ int TSAPI GetAvatarVisibility(HWND hwndDlg, TWindowData *dat) SendMessage(dat->hwndContactPic, AVATAR_SETPROTOCOL, 0, (LPARAM)dat->szProto);
if (dat->hwndContactPic)
- SendMessage(dat->hwndContactPic, AVATAR_SETCONTACT, 0, (LPARAM)dat->hContact);
+ Utils::setAvatarContact(dat->hwndContactPic, dat->hContact);
}
return dat->showPic;
}
@@ -1741,7 +1741,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) }
if (!PluginConfig.g_bDisableAniAvatars && fa.hWindow == 0 && dat->hwndPanelPic == 0) {
dat->hwndPanelPic = CreateWindowEx(WS_EX_TOPMOST, AVATAR_CONTROL_CLASS, _T(""), WS_VISIBLE | WS_CHILD, 1, 1, 1, 1, dat->hwndPanelPicParent, (HMENU)7000, NULL, NULL);
- SendMessage(dat->hwndPanelPic, AVATAR_SETCONTACT, 0, (LPARAM)dat->hContact);
+ Utils::setAvatarContact(dat->hwndPanelPic, dat->hContact);
}
}
else {
@@ -1751,7 +1751,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) }
if (!PluginConfig.g_bDisableAniAvatars && fa.hWindow == 0 && dat->hwndContactPic == 0) {
dat->hwndContactPic = CreateWindowEx(WS_EX_TOPMOST, AVATAR_CONTROL_CLASS, _T(""), WS_VISIBLE | WS_CHILD, 1, 1, 1, 1, GetDlgItem(hwndDlg, IDC_CONTACTPIC), (HMENU)0, NULL, NULL);
- SendMessage(dat->hwndContactPic, AVATAR_SETCONTACT, 0, (LPARAM)dat->hContact);
+ Utils::setAvatarContact(dat->hwndContactPic, dat->hContact);
}
}
dat->hwndFlash = fa.hWindow;
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 255347395c..ec6609ee52 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -1077,9 +1077,17 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename) return _h;
}
-/**
- * implementation of the CWarning class
- */
+/////////////////////////////////////////////////////////////////////////////////////////
+// setting avatar's contact
+
+void Utils::setAvatarContact(HWND hWnd, MCONTACT hContact)
+{
+ MCONTACT hSub = db_mc_getSrmmSub(hContact);
+ SendMessage(hWnd, AVATAR_SETCONTACT, 0, (hSub) ? hSub : hContact);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// implementation of the CWarning class
/** IMPORTANT note to translators for translation of the warning dialogs:
*
diff --git a/plugins/TabSRMM/src/utils.h b/plugins/TabSRMM/src/utils.h index 4f081363f6..fec8ab9db2 100644 --- a/plugins/TabSRMM/src/utils.h +++ b/plugins/TabSRMM/src/utils.h @@ -92,6 +92,7 @@ public: static void showDlgControl(const HWND hwnd, UINT id, int showCmd);
static int mustPlaySound(const TWindowData *dat);
static HICON iconFromAvatar(const TWindowData *dat);
+ static void setAvatarContact(HWND hWnd, MCONTACT hContact);
static void getIconSize(HICON hIcon, int& sizeX, int& sizeY);
static bool extractResource(const HMODULE h, const UINT uID, const TCHAR *tszName, const TCHAR *tszPath, const TCHAR *tszFilename, bool fForceOverwrite);
diff --git a/plugins/TabSRMM/src/version.h b/plugins/TabSRMM/src/version.h index 513123a893..275a52a6a2 100644 --- a/plugins/TabSRMM/src/version.h +++ b/plugins/TabSRMM/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 3
#define __MINOR_VERSION 3
#define __RELEASE_NUM 1
-#define __BUILD_NUM 6
+#define __BUILD_NUM 7
#include <stdver.h>
|