diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-09 17:28:47 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-09 17:28:47 +0300 |
commit | 2d737d50469b965c2787823a94757f4c9f0a7107 (patch) | |
tree | 34d46e0968485a7e9f16cbcbf9f4a18451ba06b1 /plugins/TabSRMM/src/chat_manager.cpp | |
parent | 017f8e72ac56a88ecaea40dd1c52b1da0ae46986 (diff) |
chat API:
- SESSION_INFO now addresses an instance of CChatRoomDlg instead of HWND;
- linked list of sessions replaced with the usual LIST<>;
- saveCI removed everywhere
Diffstat (limited to 'plugins/TabSRMM/src/chat_manager.cpp')
-rw-r--r-- | plugins/TabSRMM/src/chat_manager.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/TabSRMM/src/chat_manager.cpp b/plugins/TabSRMM/src/chat_manager.cpp index cff97336cf..ab7f447c4b 100644 --- a/plugins/TabSRMM/src/chat_manager.cpp +++ b/plugins/TabSRMM/src/chat_manager.cpp @@ -77,26 +77,30 @@ int UM_CompareItem(USERINFO *u1, const wchar_t* pszNick, WORD wStatus) BOOL SM_ReconfigureFilters()
{
- for (SESSION_INFO *si = pci->wndList; si; si = si->next)
- Chat_SetFilters(si);
+ for (int i = 0; i < pci->arSessions.getCount(); i++)
+ Chat_SetFilters(pci->arSessions[i]);
return TRUE;
}
SESSION_INFO* SM_FindSessionByHWND(HWND hWnd)
{
- for (SESSION_INFO *si = pci->wndList; si; si = si->next)
- if (si->hWnd == hWnd)
+ for (int i = 0; i < pci->arSessions.getCount(); i++) {
+ SESSION_INFO *si = pci->arSessions[i];
+ if (si->pDlg && si->pDlg->GetHwnd() == hWnd)
return si;
+ }
return nullptr;
}
SESSION_INFO* SM_FindSessionByHCONTACT(MCONTACT h)
{
- for (SESSION_INFO *si = pci->wndList; si; si = si->next)
+ for (int i = 0; i < pci->arSessions.getCount(); i++) {
+ SESSION_INFO *si = pci->arSessions[i];
if (si->hContact == h)
return si;
+ }
return nullptr;
}
@@ -111,13 +115,17 @@ SESSION_INFO* SM_FindSessionAutoComplete(const char* pszModule, SESSION_INFO* cu pszCurrent = pszOriginal;
SESSION_INFO *pResult = nullptr;
- for (SESSION_INFO *si = pci->wndList; si; si = si->next)
- if (si != currSession && !mir_strcmpi(pszModule, si->pszModule))
- if (my_strstri(si->ptszName, pszOriginal) == si->ptszName)
+ for (int i = 0; i < pci->arSessions.getCount(); i++) {
+ SESSION_INFO *si = pci->arSessions[i];
+ if (si != currSession && !mir_strcmpi(pszModule, si->pszModule)) {
+ if (my_strstri(si->ptszName, pszOriginal) == si->ptszName) {
if (prevSession != si && mir_wstrcmpi(si->ptszName, pszCurrent) > 0 && (!pszName || mir_wstrcmpi(si->ptszName, pszName) < 0)) {
pResult = si;
pszName = si->ptszName;
}
+ }
+ }
+ }
return pResult;
}
|