diff options
author | George Hazan <ghazan@miranda.im> | 2017-04-04 16:21:28 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-04-04 16:21:28 +0300 |
commit | cb9750e8ef71c32441c34c169101c4329a9ac8b5 (patch) | |
tree | d8379e965edb88f1c071e02e4fdf37bf5f998dd3 /src | |
parent | e3b4b1b847c5beba21cdbc5c96f07364f61ea784 (diff) |
data used by some plugins only moved to these plugins
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdmsg/src/chat_manager.cpp | 19 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_window.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/stdafx.h | 3 | ||||
-rw-r--r-- | src/mir_app/src/chat_manager.cpp | 14 | ||||
-rw-r--r-- | src/mir_app/src/chat_svc.cpp | 3 |
5 files changed, 18 insertions, 23 deletions
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index c1a2a3488c..fe7a0c3db7 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -69,13 +69,21 @@ GlobalLogSettings g_Settings; static void OnCreateModule(MODULEINFO *mi) { mi->OnlineIconIndex = ImageList_AddIcon(hIconsList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_ONLINE)); + mi->OfflineIconIndex = ImageList_AddIcon(hIconsList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_OFFLINE)); + + if (mi->hOnlineIcon) DestroyIcon(mi->hOnlineIcon); mi->hOnlineIcon = ImageList_GetIcon(hIconsList, mi->OnlineIconIndex, ILD_TRANSPARENT); + + if (mi->hOnlineTalkIcon) DestroyIcon(mi->hOnlineTalkIcon); mi->hOnlineTalkIcon = ImageList_GetIcon(hIconsList, mi->OnlineIconIndex, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1)); - ImageList_AddIcon(hIconsList, mi->hOnlineTalkIcon); - mi->OfflineIconIndex = ImageList_AddIcon(hIconsList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_OFFLINE)); + if (mi->hOfflineIcon) DestroyIcon(mi->hOfflineIcon); mi->hOfflineIcon = ImageList_GetIcon(hIconsList, mi->OfflineIconIndex, ILD_TRANSPARENT); + + if (mi->hOfflineTalkIcon) DestroyIcon(mi->hOfflineTalkIcon); mi->hOfflineTalkIcon = ImageList_GetIcon(hIconsList, mi->OfflineIconIndex, ILD_TRANSPARENT | INDEXTOOVERLAYMASK(1)); + + ImageList_AddIcon(hIconsList, mi->hOnlineTalkIcon); ImageList_AddIcon(hIconsList, mi->hOfflineTalkIcon); } @@ -85,12 +93,6 @@ static void OnReplaceSession(SESSION_INFO *si) RedrawWindow(GetDlgItem(si->pDlg->GetHwnd(), IDC_SRMM_NICKLIST), nullptr, nullptr, RDW_INVALIDATE); } -static void OnNewUser(SESSION_INFO *si, USERINFO*) -{ - if (si->pDlg) - si->pDlg->UpdateNickList(); -} - static void OnFlashHighlight(SESSION_INFO *si, int bInactive) { if (!bInactive) @@ -241,7 +243,6 @@ void Load_ChatModule() CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Chat module"), FONTMODE_SKIP }; pci = Chat_GetInterface(&data); - pci->OnNewUser = OnNewUser; pci->OnCreateModule = OnCreateModule; pci->OnReplaceSession = OnReplaceSession; diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index ea68c9c571..bc644da732 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -283,7 +283,7 @@ void CChatRoomDlg::UpdateOptions() if (m_si->iType == GCW_CHATROOM) EnableWindow(m_btnChannelMgr.GetHwnd(), mi->bChanMgr); - HICON hIcon = m_si->wStatus == ID_STATUS_ONLINE ? mi->hOnlineIcon : mi->hOfflineIcon; + HICON hIcon = (m_si->wStatus == ID_STATUS_ONLINE) ? mi->hOnlineIcon : mi->hOfflineIcon; if (!hIcon) { pci->MM_IconsChanged(); hIcon = (m_si->wStatus == ID_STATUS_ONLINE) ? mi->hOnlineIcon : mi->hOfflineIcon; diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index bb849b85d6..53cfdb2a66 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -88,6 +88,9 @@ extern CREOleCallback reOleCallback; struct MODULEINFO : public GCModuleInfoBase
{
+ HICON hOnlineIcon, hOnlineTalkIcon;
+ HICON hOfflineIcon, hOfflineTalkIcon;
+
int OnlineIconIndex;
int OfflineIconIndex;
};
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp index 7fa0e4c000..6909f66690 100644 --- a/src/mir_app/src/chat_manager.cpp +++ b/src/mir_app/src/chat_manager.cpp @@ -544,15 +544,9 @@ static void MM_IconsChanged() {
LoadChatIcons();
- for (MODULEINFO *mi = m_ModList; mi != nullptr; mi = mi->next) {
- Safe_DestroyIcon(mi->hOnlineIcon);
- Safe_DestroyIcon(mi->hOfflineIcon);
- Safe_DestroyIcon(mi->hOnlineTalkIcon);
- Safe_DestroyIcon(mi->hOfflineTalkIcon);
-
+ for (MODULEINFO *mi = m_ModList; mi != nullptr; mi = mi->next)
if (chatApi.OnCreateModule) // recreate icons
chatApi.OnCreateModule(mi);
- }
}
static void MM_FontsChanged()
@@ -588,12 +582,6 @@ static BOOL MM_RemoveAll(void) mir_free(m_ModList->ptszModDispName);
mir_free(m_ModList->pszHeader);
mir_free(m_ModList->crColors);
-
- Safe_DestroyIcon(m_ModList->hOnlineIcon);
- Safe_DestroyIcon(m_ModList->hOfflineIcon);
- Safe_DestroyIcon(m_ModList->hOnlineTalkIcon);
- Safe_DestroyIcon(m_ModList->hOfflineTalkIcon);
-
mir_free(m_ModList);
m_ModList = pLast;
}
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index 002742a66c..990eeb5169 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -392,6 +392,9 @@ static void AddUser(GCEVENT *gce) ui->Status = status;
ui->Status |= si->pStatuses->Status;
+ if (si->pDlg)
+ si->pDlg->UpdateNickList();
+
if (chatApi.OnNewUser)
chatApi.OnNewUser(si, ui);
}
|