diff options
author | George Hazan <ghazan@miranda.im> | 2016-12-19 17:17:27 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2016-12-19 17:30:39 +0300 |
commit | 877a445bdf3ac484e564bb1d62610eeb1329e991 (patch) | |
tree | 245ddad068e973c3abb54b304cc7e3ae8cafb0f4 /src | |
parent | b95a789fc6c46eb3b56011946b259fe57159d69c (diff) |
unused member removed
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdmsg/src/chat_manager.cpp | 23 | ||||
-rw-r--r-- | src/mir_app/src/chat_clist.cpp | 9 | ||||
-rw-r--r-- | src/mir_app/src/chat_manager.cpp | 30 | ||||
-rw-r--r-- | src/mir_app/src/chat_svc.cpp | 4 |
4 files changed, 19 insertions, 47 deletions
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index b1f45c943e..0f30acdbc1 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -93,32 +93,12 @@ static void OnCreateModule(MODULEINFO *mi) ImageList_AddIcon(hIconsList, mi->hOfflineTalkIcon); } -static void OnDblClickSession(SESSION_INFO *si) -{ - if (g_Settings.bTabsEnable) - SendMessage(GetParent(GetParent(si->hWnd)), GC_REMOVETAB, 0, (LPARAM)si->pDlg); - else - PostMessage(si->hWnd, GC_CLOSEWINDOW, 0, 0); -} - -static void OnRemoveSession(SESSION_INFO *si) -{ - if (si->hWnd) - SendMessage(si->hWnd, GC_CONTROL_MSG, SESSION_TERMINATE, 0); -} - static void OnReplaceSession(SESSION_INFO *si) { if (si->hWnd) RedrawWindow(GetDlgItem(si->hWnd, IDC_LIST), NULL, NULL, RDW_INVALIDATE); } -static void OnSetStatusBar(SESSION_INFO *si) -{ - if (si->hWnd) - SendMessage(si->hWnd, GC_UPDATESTATUSBAR, 0, 0); -} - static void OnNewUser(SESSION_INFO *si, USERINFO*) { if (si->hWnd) @@ -230,12 +210,9 @@ void Load_ChatModule() pci->OnNewUser = OnNewUser; pci->OnCreateModule = OnCreateModule; - pci->OnRemoveSession = OnRemoveSession; pci->OnReplaceSession = OnReplaceSession; - pci->OnDblClickSession = OnDblClickSession; pci->OnLoadSettings = OnLoadSettings; - pci->OnSetStatusBar = OnSetStatusBar; pci->OnFlashWindow = OnFlashWindow; pci->OnFlashHighlight = OnFlashHighlight; pci->ShowRoom = ShowRoom; diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp index c2aec1fb3e..27268d8a8d 100644 --- a/src/mir_app/src/chat_clist.cpp +++ b/src/mir_app/src/chat_clist.cpp @@ -117,13 +117,8 @@ int RoomDoubleclicked(WPARAM hContact, LPARAM) SESSION_INFO *si = SM_FindSession(roomid, szProto);
if (si) {
// is the "toggle visibility option set, so we need to close the window?
- if (si->hWnd != NULL &&
- db_get_b(NULL, CHAT_MODULE, "ToggleVisibility", 0) == 1 &&
- !cli.pfnGetEvent(hContact, 0) &&
- IsWindowVisible(si->hWnd) && !IsIconic(si->hWnd))
- {
- if (chatApi.OnDblClickSession)
- chatApi.OnDblClickSession(si);
+ if (si->hWnd != NULL && db_get_b(NULL, CHAT_MODULE, "ToggleVisibility", 0) == 1 && !cli.pfnGetEvent(hContact, 0) && IsWindowVisible(si->hWnd) && !IsIconic(si->hWnd)) {
+ PostMessage(si->hWnd, GC_CLOSEWINDOW, 0, 0);
return 1;
}
chatApi.ShowRoom(si, WINDOW_VISIBLE, TRUE);
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 3c0bc47c8a..7ea1f9bdd1 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -99,37 +99,37 @@ int SM_RemoveSession(const wchar_t *pszID, const char *pszModule, BOOL removeCon if (!pszModule)
return FALSE;
- SESSION_INFO *pTemp = chatApi.wndList, *pLast = NULL;
- while (pTemp != NULL) {
+ SESSION_INFO *si = chatApi.wndList, *pLast = NULL;
+ while (si != NULL) {
// match
- if ((!pszID && pTemp->iType != GCW_SERVER || !mir_wstrcmpi(pTemp->ptszID, pszID)) && !mir_strcmpi(pTemp->pszModule, pszModule)) {
- if (chatApi.OnRemoveSession)
- chatApi.OnRemoveSession(pTemp);
- DoEventHook(pTemp->ptszID, pTemp->pszModule, GC_SESSION_TERMINATE, NULL, NULL, (INT_PTR)pTemp->pItemData);
+ if ((!pszID && si->iType != GCW_SERVER || !mir_wstrcmpi(si->ptszID, pszID)) && !mir_strcmpi(si->pszModule, pszModule)) {
+ if (si->hWnd)
+ SendMessage(si->hWnd, GC_CONTROL_MSG, SESSION_TERMINATE, 0);
+ DoEventHook(si->ptszID, si->pszModule, GC_SESSION_TERMINATE, NULL, NULL, (INT_PTR)si->pItemData);
if (pLast == NULL)
- chatApi.wndList = pTemp->next;
+ chatApi.wndList = si->next;
else
- pLast->next = pTemp->next;
+ pLast->next = si->next;
// contact may have been deleted here already, since function may be called after deleting
// contact so the handle may be invalid, therefore db_get_b shall return 0
- if (pTemp->hContact && removeContact)
- db_delete_contact(pTemp->hContact);
+ if (si->hContact && removeContact)
+ db_delete_contact(si->hContact);
- SM_FreeSession(pTemp);
+ SM_FreeSession(si);
if (pszID)
return 1;
if (pLast)
- pTemp = pLast->next;
+ si = pLast->next;
else
- pTemp = chatApi.wndList;
+ si = chatApi.wndList;
}
else {
- pLast = pTemp;
- pTemp = pTemp->next;
+ pLast = si;
+ si = si->next;
}
}
return FALSE;
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index a7fbb86c97..edd6dab94e 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -674,8 +674,8 @@ MIR_APP_DLL(int) Chat_SetStatusbarText(const char *szModule, const wchar_t *wszI else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
- if (chatApi.OnSetStatusBar)
- chatApi.OnSetStatusBar(si);
+ if (si->hWnd)
+ SendMessage(si->hWnd, GC_UPDATESTATUSBAR, 0, 0);
}
return 0;
}
|