summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/msgs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM/src/msgs.cpp')
-rw-r--r--plugins/TabSRMM/src/msgs.cpp69
1 files changed, 17 insertions, 52 deletions
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index d6ccb076ab..5d3799b8a3 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -280,37 +280,28 @@ void CTabBaseDlg::NotifyDeliveryFailure() const
/////////////////////////////////////////////////////////////////////////////////////////
// service function. Sets a status bar text for a contact
-static void SetStatusTextWorker(CTabBaseDlg *dat, StatusTextData *st)
+static INT_PTR SetStatusText(WPARAM hContact, LPARAM lParam)
{
- if (!dat)
- return;
+ HWND hwnd = M.FindWindow(hContact);
+ if (hwnd == nullptr)
+ hwnd = M.FindWindow(db_mc_getMeta(hContact));
+ if (hwnd == nullptr)
+ return 0;
- // delete old custom data
- if (dat->m_sbCustom) {
- delete dat->m_sbCustom;
- dat->m_sbCustom = nullptr;
- }
+ 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;
+ }
- if (st != nullptr)
- dat->m_sbCustom = new StatusTextData(*st);
+ StatusTextData *st = (StatusTextData*)lParam;
+ if (st != nullptr)
+ pDlg->m_sbCustom = new StatusTextData(*st);
- dat->tabUpdateStatusBar();
-}
-
-static INT_PTR SetStatusText(WPARAM hContact, LPARAM lParam)
-{
- SESSION_INFO *si = SM_FindSessionByHCONTACT(hContact);
- if (si == nullptr) {
- HWND hwnd = M.FindWindow(hContact);
- if (hwnd != nullptr)
- SetStatusTextWorker((CTabBaseDlg*)GetWindowLongPtr(hwnd, GWLP_USERDATA), (StatusTextData*)lParam);
-
- if (hContact = db_mc_getMeta(hContact))
- if (hwnd = M.FindWindow(hContact))
- SetStatusTextWorker((CTabBaseDlg*)GetWindowLongPtr(hwnd, GWLP_USERDATA), (StatusTextData*)lParam);
+ pDlg->tabUpdateStatusBar();
}
- else SetStatusTextWorker(si->pDlg, (StatusTextData*)lParam);
-
return 0;
}
@@ -338,28 +329,6 @@ static INT_PTR Service_OpenTrayMenu(WPARAM, LPARAM lParam)
}
/////////////////////////////////////////////////////////////////////////////////////////
-// return the version of the window api supported
-
-static INT_PTR BroadcastMessage(WPARAM, LPARAM lParam)
-{
- M.BroadcastMessage((UINT)lParam, 0, 0);
- return 0;
-}
-
-static INT_PTR ReloadSkin(WPARAM, LPARAM)
-{
- Skin->setFileName();
- Skin->Load();
- return 0;
-}
-
-static INT_PTR ReloadSettings(WPARAM, LPARAM lParam)
-{
- PluginConfig.reloadSettings(lParam != 0);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// service function finds a message session
// wParam = contact handle for which we want the window handle
// thanks to bio for the suggestion of this service
@@ -1046,10 +1015,6 @@ static void TSAPI InitAPI()
CreateServiceFunction(MS_TABMSG_TRAYSUPPORT, Service_OpenTrayMenu);
CreateServiceFunction(MS_TABMSG_SLQMGR, CSendLater::svcQMgr);
- CreateServiceFunction("SRMsg/BroadcastMessage", BroadcastMessage);
- CreateServiceFunction("TabSRMsg/ReloadSkin", ReloadSkin);
- CreateServiceFunction("TabSRMsg/ReloadSettings", ReloadSettings);
-
SI_InitStatusIcons();
CB_InitCustomButtons();