summaryrefslogtreecommitdiff
path: root/src/mir_app
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-19 17:17:27 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-19 17:30:39 +0300
commit877a445bdf3ac484e564bb1d62610eeb1329e991 (patch)
tree245ddad068e973c3abb54b304cc7e3ae8cafb0f4 /src/mir_app
parentb95a789fc6c46eb3b56011946b259fe57159d69c (diff)
unused member removed
Diffstat (limited to 'src/mir_app')
-rw-r--r--src/mir_app/src/chat_clist.cpp9
-rw-r--r--src/mir_app/src/chat_manager.cpp30
-rw-r--r--src/mir_app/src/chat_svc.cpp4
3 files changed, 19 insertions, 24 deletions
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;
}