summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/msgs.cpp
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 /plugins/TabSRMM/src/msgs.cpp
parentd05dd78157058eea348f0d7666c7c6b0570ef25b (diff)
fixes #799 (Crash on receiving msg in FB group chat)
Diffstat (limited to 'plugins/TabSRMM/src/msgs.cpp')
-rw-r--r--plugins/TabSRMM/src/msgs.cpp32
1 files changed, 7 insertions, 25 deletions
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 7325c07702..3a88bd7ee1 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -74,7 +74,6 @@ CTabBaseDlg::CTabBaseDlg(int iResource, SESSION_INFO *si)
CTabBaseDlg::~CTabBaseDlg()
{
delete m_pWnd;
- delete m_sbCustom;
mir_free(m_sendBuffer);
mir_free(m_hHistoryEvents);
@@ -278,31 +277,15 @@ void CTabBaseDlg::NotifyDeliveryFailure() const
}
/////////////////////////////////////////////////////////////////////////////////////////
-// service function. Sets a status bar text for a contact
+// Sets a status bar text for a contact
-static INT_PTR SetStatusText(WPARAM hContact, LPARAM lParam)
+void CTabBaseDlg::SetStatusText(const wchar_t *wszText, HICON hIcon)
{
- HWND hwnd = Srmm_FindWindow(hContact);
- if (hwnd == nullptr)
- hwnd = Srmm_FindWindow(db_mc_getMeta(hContact));
- if (hwnd == nullptr)
- return 0;
-
- CTabBaseDlg *pDlg = (CTabBaseDlg*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (pDlg != nullptr) {
- // delete old custom data
- if (pDlg->m_sbCustom) {
- delete pDlg->m_sbCustom;
- pDlg->m_sbCustom = nullptr;
- }
-
- StatusTextData *st = (StatusTextData*)lParam;
- if (st != nullptr)
- pDlg->m_sbCustom = new StatusTextData(*st);
-
- pDlg->tabUpdateStatusBar();
- }
- return 0;
+ m_bStatusSet = true;
+ m_szStatusText = wszText;
+ m_szStatusIcon = hIcon;
+
+ tabUpdateStatusBar();
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1023,7 +1006,6 @@ static void TSAPI InitAPI()
{
CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand);
CreateServiceFunction(MS_MSG_SENDMESSAGEW, SendMessageCommand_W);
- CreateServiceFunction(MS_MSG_SETSTATUSTEXT, SetStatusText);
CreateServiceFunction("TabSRMsg/ReloadSkin", ReloadSkin);
CreateServiceFunction("TabSRMsg/ReloadSettings", ReloadSettings);