summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-28 18:44:24 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-28 18:44:24 +0300
commit2cf63b38b3ddc616a18847a29ab36790138a168a (patch)
treecd108e21f71cb5f6626b1b788e70a419852a5d3d /plugins
parent1ab93d3afabe3a5872040b5acafc9f113c196a2b (diff)
more unneeded code removed
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Scriver/src/chat.h1
-rw-r--r--plugins/Scriver/src/chat_manager.cpp17
-rw-r--r--plugins/Scriver/src/msgs.cpp10
-rw-r--r--plugins/Scriver/src/statusicon.cpp2
-rw-r--r--plugins/Scriver/src/stdafx.h1
-rw-r--r--plugins/TabSRMM/src/msgs.cpp69
6 files changed, 22 insertions, 78 deletions
diff --git a/plugins/Scriver/src/chat.h b/plugins/Scriver/src/chat.h
index 8d40bbd6f2..f4bee7dcfb 100644
--- a/plugins/Scriver/src/chat.h
+++ b/plugins/Scriver/src/chat.h
@@ -74,7 +74,6 @@ void FreeMsgLogBitmaps(void);
void ShowRoom(SESSION_INFO *si);
// manager.c
-HWND SM_FindWindowByContact(MCONTACT hContact);
SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent);
char SM_GetStatusIndicator(SESSION_INFO *si, USERINFO *ui);
diff --git a/plugins/Scriver/src/chat_manager.cpp b/plugins/Scriver/src/chat_manager.cpp
index f86764560a..c763f15e6a 100644
--- a/plugins/Scriver/src/chat_manager.cpp
+++ b/plugins/Scriver/src/chat_manager.cpp
@@ -21,23 +21,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-HWND SM_FindWindowByContact(MCONTACT hContact)
-{
- for (int i = 0; i < pci->arSessions.getCount(); i++) {
- SESSION_INFO *si = pci->arSessions[i];
- if (si->hContact == hContact)
- return (si->pDlg) ? si->pDlg->GetHwnd() : nullptr;
- }
- return nullptr;
-}
-
SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO *currSession, SESSION_INFO *prevSession, const wchar_t *pszOriginal, const wchar_t *pszCurrent)
{
- SESSION_INFO* pResult = nullptr;
+ SESSION_INFO *pResult = nullptr;
if (prevSession == nullptr && my_strstri(currSession->ptszName, pszOriginal) == currSession->ptszName)
pResult = currSession;
else {
- wchar_t* pszName = nullptr;
+ wchar_t *pszName = nullptr;
if (currSession == prevSession)
pszCurrent = pszOriginal;
@@ -58,11 +48,10 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO *cu
char SM_GetStatusIndicator(SESSION_INFO *si, USERINFO *ui)
{
- STATUSINFO * ti;
if (!ui || !si)
return '\0';
- ti = pci->TM_FindStatus(si->pStatuses, pci->TM_WordToString(si->pStatuses, ui->Status));
+ STATUSINFO *ti = pci->TM_FindStatus(si->pStatuses, pci->TM_WordToString(si->pStatuses, ui->Status));
if (ti) {
if ((INT_PTR)ti->hIcon < STATUSICONCOUNT) {
INT_PTR id = si->iStatusCount - (INT_PTR)ti->hIcon - 1;
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 2be9a2c810..1b3ac3df92 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -290,11 +290,8 @@ static INT_PTR SetStatusText(WPARAM hContact, LPARAM lParam)
return 1;
HWND hwnd = WindowList_Find(pci->hWindowList, hContact);
- if (hwnd == nullptr) {
- hwnd = SM_FindWindowByContact(hContact);
- if (hwnd == nullptr)
- return 1;
- }
+ if (hwnd == nullptr)
+ return 1;
CScriverWindow *dat = (CScriverWindow*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat == nullptr || dat->m_pParent == nullptr)
@@ -438,9 +435,6 @@ int StatusIconPressed(WPARAM wParam, LPARAM lParam)
return 0;
HWND hwnd = WindowList_Find(pci->hWindowList, wParam);
- if (hwnd == nullptr)
- hwnd = SM_FindWindowByContact(wParam);
-
if (hwnd != nullptr)
SendMessage(hwnd, DM_SWITCHTYPING, 0, 0);
return 0;
diff --git a/plugins/Scriver/src/statusicon.cpp b/plugins/Scriver/src/statusicon.cpp
index 401ef8335f..f59c9f8ede 100644
--- a/plugins/Scriver/src/statusicon.cpp
+++ b/plugins/Scriver/src/statusicon.cpp
@@ -65,8 +65,6 @@ static int OnSrmmIconChanged(WPARAM hContact, LPARAM)
WindowList_Broadcast(g_dat.hParentWindowList, DM_STATUSICONCHANGE, 0, 0);
else {
HWND hwnd = WindowList_Find(pci->hWindowList, hContact);
- if (hwnd == nullptr)
- hwnd = SM_FindWindowByContact(hContact);
if (hwnd != nullptr)
PostMessage(GetParent(hwnd), DM_STATUSICONCHANGE, 0, 0);
}
diff --git a/plugins/Scriver/src/stdafx.h b/plugins/Scriver/src/stdafx.h
index 09d0124a84..7100a13efb 100644
--- a/plugins/Scriver/src/stdafx.h
+++ b/plugins/Scriver/src/stdafx.h
@@ -87,7 +87,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CFM_WEIGHT 0x00400000
#endif
-extern HWND SM_FindWindowByContact(MCONTACT hContact);
extern HINSTANCE g_hInst;
extern HCURSOR hDragCursor;
extern ITaskbarList3 *pTaskbarInterface;
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();