diff options
author | George Hazan <ghazan@miranda.im> | 2017-08-15 13:49:37 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-08-15 13:49:37 +0300 |
commit | f52b5cc86d9eff2494902157c8fc0a4e019a3c95 (patch) | |
tree | 9f668bf7b89decd53757589d74e476aac81eb451 /plugins/Scriver | |
parent | d05dd78157058eea348f0d7666c7c6b0570ef25b (diff) |
fixes #799 (Crash on receiving msg in FB group chat)
Diffstat (limited to 'plugins/Scriver')
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 26 | ||||
-rw-r--r-- | plugins/Scriver/src/msgs.h | 1 |
2 files changed, 8 insertions, 19 deletions
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 58d97fbf1e..a335489ee8 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -284,25 +284,13 @@ static void RestoreUnreadMessageAlerts(void) }
}
-static INT_PTR SetStatusText(WPARAM hContact, LPARAM lParam)
+void CScriverWindow::SetStatusText(const wchar_t *wszText, HICON hIcon)
{
- StatusTextData *st = (StatusTextData*)lParam;
- if (st == nullptr)
- return 1;
-
- HWND hwnd = Srmm_FindWindow(hContact);
- if (hwnd == nullptr)
- return 1;
-
- CScriverWindow *dat = (CScriverWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (dat == nullptr || dat->m_pParent == nullptr)
- return 1;
-
- ParentWindowData *pdat = dat->m_pParent;
-
- SendMessage(pdat->hwndStatus, SB_SETICON, 0, (LPARAM)(st == nullptr ? 0 : st->hIcon));
- SendMessage(pdat->hwndStatus, SB_SETTEXT, 0, (LPARAM)(st == nullptr ? L"" : st->tszText));
- return 0;
+ ParentWindowData *pDat = m_pParent;
+ if (pDat != nullptr) {
+ SendMessage(pDat->hwndStatus, SB_SETICON, 0, (LPARAM)hIcon);
+ SendMessage(pDat->hwndStatus, SB_SETTEXT, 0, (LPARAM)wszText);
+ }
}
static int PrebuildContactMenu(WPARAM hContact, LPARAM)
@@ -656,7 +644,7 @@ int OnLoadModule(void) CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand);
CreateServiceFunction(MS_MSG_SENDMESSAGEW, SendMessageCommandW);
- CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText);
+
CreateServiceFunction("SRMsg/ReadMessage", ReadMessageCommand);
CreateServiceFunction("SRMsg/TypingMessage", TypingMessageCommand);
diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index ff758a3416..86de8bf663 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -97,6 +97,7 @@ protected: public:
virtual void CloseTab() override;
virtual void LoadSettings() override;
+ virtual void SetStatusText(const wchar_t*, HICON) override;
void Reattach(HWND hwndContainer);
|