summaryrefslogtreecommitdiff
path: root/src/core/stdmsg
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-08-15 13:49:37 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-08-15 13:49:37 +0300
commitf52b5cc86d9eff2494902157c8fc0a4e019a3c95 (patch)
tree9f668bf7b89decd53757589d74e476aac81eb451 /src/core/stdmsg
parentd05dd78157058eea348f0d7666c7c6b0570ef25b (diff)
fixes #799 (Crash on receiving msg in FB group chat)
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp6
-rw-r--r--src/core/stdmsg/src/msgs.cpp19
-rw-r--r--src/core/stdmsg/src/msgs.h2
3 files changed, 4 insertions, 23 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 758842535e..7646c4e7ed 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -561,10 +561,10 @@ void CSrmmWindow::SetupStatusBar()
SendMessage(m_hwnd, DM_STATUSICONCHANGE, 0, 0);
}
-void CSrmmWindow::SetStatusData(StatusTextData *st)
+void CSrmmWindow::SetStatusText(const wchar_t *wszText, HICON hIcon)
{
- SendMessage(m_pOwner->m_hwndStatus, SB_SETICON, 0, (LPARAM)(st == nullptr ? 0 : st->hIcon));
- SendMessage(m_pOwner->m_hwndStatus, SB_SETTEXT, 0, (LPARAM)(st == nullptr ? L"" : st->tszText));
+ SendMessage(m_pOwner->m_hwndStatus, SB_SETICON, 0, (LPARAM)hIcon);
+ SendMessage(m_pOwner->m_hwndStatus, SB_SETTEXT, 0, (LPARAM)wszText);
}
void CSrmmWindow::UpdateReadChars()
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index bffa4588be..6d302f3111 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -479,24 +479,6 @@ static int PrebuildContactMenu(WPARAM hContact, LPARAM)
return 0;
}
-static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
-{
- StatusTextData *st = (StatusTextData*)lParam;
- if (st == nullptr)
- return 1;
-
- HWND hwnd = Srmm_FindWindow(wParam);
- if (hwnd == nullptr)
- return 1;
-
- CSrmmWindow *dat = (CSrmmWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (dat == nullptr)
- return 1;
-
- dat->SetStatusData(st);
- return 0;
-}
-
static wchar_t tszError[] = LPGENW("Miranda could not load the built-in message module, msftedit.dll is missing. Press 'Yes' to continue loading Miranda.");
int LoadSendRecvMessageModule(void)
@@ -521,7 +503,6 @@ int LoadSendRecvMessageModule(void)
CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand);
CreateServiceFunction(MS_MSG_SENDMESSAGEW, SendMessageCommand_W);
- CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText);
CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand);
SkinAddNewSoundEx("RecvMsgActive", LPGEN("Instant messages"), LPGEN("Incoming (focused window)"));
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h
index fea335010a..a94cb6a08d 100644
--- a/src/core/stdmsg/src/msgs.h
+++ b/src/core/stdmsg/src/msgs.h
@@ -112,6 +112,7 @@ public:
virtual void CloseTab() override;
virtual void LoadSettings() override {}
virtual void ScrollToBottom() override;
+ virtual void SetStatusText(const wchar_t*, HICON) override;
virtual void UpdateTitle() override {}
void OnSplitterMoved(CSplitter*);
@@ -120,7 +121,6 @@ public:
void OnOptionsApplied(bool bUpdateAvatar);
- void SetStatusData(StatusTextData*);
void UpdateReadChars(void);
__forceinline MCONTACT getActiveContact() const