summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-08-02 12:47:29 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-08-02 12:47:34 +0300
commit3b014e321cb0b4fd9ff761cf145b94f71576fdd8 (patch)
treeccdafd9d8e802d4968a543458757eb7e0b0b0891 /plugins/TabSRMM/src
parenta6137a56ef842f439e1c1a2a26bb6caec1ab69d7 (diff)
unused code removed
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/chat.h1
-rw-r--r--plugins/TabSRMM/src/chat_manager.cpp9
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp37
3 files changed, 15 insertions, 32 deletions
diff --git a/plugins/TabSRMM/src/chat.h b/plugins/TabSRMM/src/chat.h
index 29fd9e4596..50c731b287 100644
--- a/plugins/TabSRMM/src/chat.h
+++ b/plugins/TabSRMM/src/chat.h
@@ -86,7 +86,6 @@ HICON LoadIconEx(char *pszIcoLibName);
void ShowRoom(TContainerData *pContainer, SESSION_INFO *si);
// manager.c
-SESSION_INFO* SM_FindSessionByHWND(HWND h);
SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h);
SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* currSession, SESSION_INFO* prevSession, const wchar_t* pszOriginal, const wchar_t* pszCurrent);
diff --git a/plugins/TabSRMM/src/chat_manager.cpp b/plugins/TabSRMM/src/chat_manager.cpp
index da423141cd..b861e79f6e 100644
--- a/plugins/TabSRMM/src/chat_manager.cpp
+++ b/plugins/TabSRMM/src/chat_manager.cpp
@@ -72,15 +72,6 @@ int UM_CompareItem(const USERINFO *u1, const USERINFO *u2)
// Keeps track of all sessions and its windows
//---------------------------------------------------
-SESSION_INFO* SM_FindSessionByHWND(HWND hWnd)
-{
- for (auto &si : g_chatApi.arSessions)
- if (si->pDlg && si->pDlg->GetHwnd() == hWnd)
- return si;
-
- return nullptr;
-}
-
SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h)
{
for (auto &si : g_chatApi.arSessions)
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index 1c649e6c4c..591cf73423 100644
--- a/plugins/TabSRMM/src/hotkeyhandler.cpp
+++ b/plugins/TabSRMM/src/hotkeyhandler.cpp
@@ -182,31 +182,24 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (dis->CtlType == ODT_MENU) {
HWND hWnd = Srmm_FindWindow((MCONTACT)dis->itemID);
- uint32_t idle = 0;
-
- if (hWnd == nullptr) {
- SESSION_INFO *si = SM_FindSessionByHCONTACT((MCONTACT)dis->itemID);
- hWnd = si ? si->pDlg->GetHwnd() : nullptr;
- }
-
- CMsgDialog *dat = nullptr;
- if (hWnd)
- dat = (CMsgDialog*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
+ if (hWnd == nullptr)
+ if (SESSION_INFO *si = SM_FindSessionByHCONTACT((MCONTACT)dis->itemID))
+ hWnd = si->pDlg->GetHwnd();
- {
- HICON hIcon;
+ CMsgDialog *dat = (hWnd) ? (CMsgDialog*)GetWindowLongPtr(hWnd, GWLP_USERDATA) : nullptr;
- if (dis->itemData > 0)
- hIcon = (dis->itemData & 0x10000000) ? g_chatApi.getIcon(GC_EVENT_HIGHLIGHT) : PluginConfig.g_IconMsgEvent;
- else if (dat != nullptr) {
- hIcon = dat->GetMyContactIcon(nullptr);
- idle = dat->m_idle;
- }
- else hIcon = PluginConfig.g_iconContainer;
-
- DrawMenuItem(dis, hIcon, idle);
- return TRUE;
+ HICON hIcon;
+ uint32_t idle = 0;
+ if (dis->itemData > 0)
+ hIcon = (dis->itemData & 0x10000000) ? g_chatApi.getIcon(GC_EVENT_HIGHLIGHT) : PluginConfig.g_IconMsgEvent;
+ else if (dat != nullptr) {
+ hIcon = dat->GetMyContactIcon(nullptr);
+ idle = dat->m_idle;
}
+ else hIcon = PluginConfig.g_iconContainer;
+
+ DrawMenuItem(dis, hIcon, idle);
+ return TRUE;
}
}
break;