summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-08-09 20:05:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-08-09 20:05:04 +0300
commit5b15ed8d1ba3fa49b68b95597483c6700d8ec258 (patch)
tree470e7f913b9bcede18c06a7049a13d45dc94ef08
parentd6233ace5e3a372a49dcbcfb26a931fb29e530cf (diff)
Steam: protocol menu items are displayed for all contacts (partially covers #1538)
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp4
-rw-r--r--protocols/Steam/src/steam_dialogs.h4
-rw-r--r--protocols/Steam/src/steam_events.cpp2
-rw-r--r--protocols/Steam/src/steam_menus.cpp9
-rw-r--r--protocols/Steam/src/version.h2
5 files changed, 9 insertions, 12 deletions
diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp
index 7e5cd0f93d..3277f3fa2b 100644
--- a/protocols/Steam/src/steam_dialogs.cpp
+++ b/protocols/Steam/src/steam_dialogs.cpp
@@ -118,7 +118,7 @@ const char* CSteamTwoFactorDialog::GetTwoFactorCode()
/////////////////////////////////////////////////////////////////////////////////
-CSteamCaptchaDialog::CSteamCaptchaDialog(CSteamProto *proto, const uint8_t *captchaImage, int captchaImageSize)
+CSteamCaptchaDialog::CSteamCaptchaDialog(CSteamProto *proto, const uint8_t *captchaImage, size_t captchaImageSize)
: CSteamDlgBase(proto, IDD_CAPTCHA),
m_ok(this, IDOK), m_text(this, IDC_TEXT),
m_captchaImage(nullptr)
@@ -163,7 +163,7 @@ bool CSteamCaptchaDialog::OnClose()
INT_PTR CSteamCaptchaDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_PAINT) {
- FIMEMORY *stream = FreeImage_OpenMemory(m_captchaImage, m_captchaImageSize);
+ FIMEMORY *stream = FreeImage_OpenMemory(m_captchaImage, (DWORD)m_captchaImageSize);
FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeFromMemory(stream, 0);
FIBITMAP *bitmap = FreeImage_LoadFromMemory(fif, stream, 0);
FreeImage_CloseMemory(stream);
diff --git a/protocols/Steam/src/steam_dialogs.h b/protocols/Steam/src/steam_dialogs.h
index 8086114c42..231539229a 100644
--- a/protocols/Steam/src/steam_dialogs.h
+++ b/protocols/Steam/src/steam_dialogs.h
@@ -79,7 +79,7 @@ private:
char m_captchaText[7];
uint8_t *m_captchaImage;
- int m_captchaImageSize;
+ size_t m_captchaImageSize;
CCtrlEdit m_text;
CCtrlButton m_ok;
@@ -92,7 +92,7 @@ protected:
void OnOk(CCtrlButton*);
public:
- CSteamCaptchaDialog(CSteamProto *proto, const uint8_t *captchaImage, int captchaImageSize);
+ CSteamCaptchaDialog(CSteamProto *proto, const uint8_t *captchaImage, size_t captchaImageSize);
~CSteamCaptchaDialog();
const char *GetCaptchaText();
diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp
index b74dc8305b..f98573de45 100644
--- a/protocols/Steam/src/steam_events.cpp
+++ b/protocols/Steam/src/steam_events.cpp
@@ -8,8 +8,6 @@ void CSteamProto::OnModulesLoaded()
HookProtoEvent(ME_IDLE_CHANGED, &CSteamProto::OnIdleChanged);
HookProtoEvent(ME_MSG_PRECREATEEVENT, &CSteamProto::OnPreCreateMessage);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU, &CSteamProto::PrebuildContactMenu);
-
// Register custom db event
DBEVENTTYPEDESCR dbEventType = { sizeof(dbEventType) };
dbEventType.module = m_szModuleName;
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp
index c14b086b83..b8f9aec6b6 100644
--- a/protocols/Steam/src/steam_menus.cpp
+++ b/protocols/Steam/src/steam_menus.cpp
@@ -83,9 +83,6 @@ INT_PTR CSteamProto::OpenBlockListCommand(WPARAM, LPARAM)
int CSteamProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
{
- for (auto &it : contactMenuItems)
- Menu_ShowItem(it, false);
-
if (!hContact)
return 0;
@@ -110,8 +107,8 @@ int CSteamProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
int CSteamProto::PrebuildContactMenu(WPARAM hContact, LPARAM lParam)
{
- for (int i = 0; i < CMI_MAX; i++)
- Menu_ShowItem(CSteamProto::contactMenuItems[i], false);
+ for (auto &it : contactMenuItems)
+ Menu_ShowItem(it, false);
CSteamProto *ppro = CMPlugin::getInstance((MCONTACT)hContact);
return (ppro) ? ppro->OnPrebuildContactMenu(hContact, lParam) : 0;
@@ -168,4 +165,6 @@ void CSteamProto::InitMenus()
mi.hIcolibItem = nullptr;
contactMenuItems[CMI_JOIN_GAME] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSteamProto::JoinToGameCommand>);
+
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, &CSteamProto::PrebuildContactMenu);
}
diff --git a/protocols/Steam/src/version.h b/protocols/Steam/src/version.h
index 6e3077a59a..c97ede548d 100644
--- a/protocols/Steam/src/version.h
+++ b/protocols/Steam/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 11
#define __RELEASE_NUM 6
-#define __BUILD_NUM 4
+#define __BUILD_NUM 5
#include <stdver.h>