From 176e52e14fd0358a7f26ca8d7b0205244dfde2e7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 23 May 2018 23:29:25 +0300 Subject: no need to initialize pcli variable in each plugin (only in Clist_*) --- src/core/stdmsg/src/chat_manager.cpp | 4 ++-- src/core/stdmsg/src/chat_window.cpp | 4 ++-- src/core/stdmsg/src/msgdialog.cpp | 2 +- src/core/stdmsg/src/msglog.cpp | 2 +- src/core/stdmsg/src/msgs.cpp | 10 +++++----- src/core/stdmsg/src/srmm.cpp | 4 ---- src/core/stdmsg/src/tabs.cpp | 4 ++-- 7 files changed, 13 insertions(+), 17 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index 9a3885baa6..26b834617e 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -75,10 +75,10 @@ static void OnCreateModule(MODULEINFO *mi) { OnDestroyModule(mi); - mi->OnlineIconIndex = pcli->pfnIconFromStatusMode(mi->pszModule, ID_STATUS_ONLINE, 0); + mi->OnlineIconIndex = g_CLI.pfnIconFromStatusMode(mi->pszModule, ID_STATUS_ONLINE, 0); mi->hOnlineIcon = ImageList_GetIcon(Clist_GetImageList(), mi->OnlineIconIndex, ILD_TRANSPARENT); - mi->OfflineIconIndex = pcli->pfnIconFromStatusMode(mi->pszModule, ID_STATUS_OFFLINE, 0); + mi->OfflineIconIndex = g_CLI.pfnIconFromStatusMode(mi->pszModule, ID_STATUS_OFFLINE, 0); mi->hOfflineIcon = ImageList_GetIcon(Clist_GetImageList(), mi->OfflineIconIndex, ILD_TRANSPARENT); } diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index f6e101eb5f..66be4aaba6 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -104,8 +104,8 @@ void CChatRoomDlg::OnActivate() FlashWindow(m_pOwner->GetHwnd(), FALSE); if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0) db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0); - if (pcli->pfnGetEvent(m_hContact, 0)) - pcli->pfnRemoveEvent(m_hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(m_hContact, 0)) + g_CLI.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT); } void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton) diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index e65ea3f177..5bfcb1f191 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -455,7 +455,7 @@ void CSrmmWindow::OnSplitterMoved(CSplitter *pSplitter) int CSrmmWindow::GetImageId() const { - return (WORD)pcli->pfnIconFromStatusMode(m_szProto, m_wStatus, m_hContact); + return (WORD)g_CLI.pfnIconFromStatusMode(m_szProto, m_wStatus, m_hContact); } void CSrmmWindow::NotifyTyping(int mode) diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index b06bdb9b64..029d72a8e2 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -215,7 +215,7 @@ static bool CreateRTFFromDbEvent(LogStreamData *dat) if (!(dbei.flags & DBEF_SENT) && (dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) { db_event_markRead(dat->hContact, dat->hDbEvent); - pcli->pfnRemoveEvent(dat->hContact, dat->hDbEvent); + g_CLI.pfnRemoveEvent(dat->hContact, dat->hDbEvent); } else if (dbei.eventType == EVENTTYPE_JABBER_CHATSTATES || dbei.eventType == EVENTTYPE_JABBER_PRESENCE) { db_event_markRead(dat->hContact, dat->hDbEvent); diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index c141710293..9f4532041b 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -90,7 +90,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) if (dbei.flags & (DBEF_SENT | DBEF_READ) || !(dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) return 0; - pcli->pfnRemoveEvent(hContact, 1); + g_CLI.pfnRemoveEvent(hContact, 1); /* does a window for the contact exist? */ HWND hwnd = Srmm_FindWindow(hContact); if (hwnd) { @@ -127,7 +127,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); cle.pszService = MS_MSG_READMESSAGE; cle.szTooltip.w = toolTip; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); return 0; } @@ -200,7 +200,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) mir_snwprintf(szTip, TranslateT("%s is typing a message"), Clist_GetContactDisplayName(hContact)); if (g_dat.bShowTypingClist) { - pcli->pfnRemoveEvent(hContact, 1); + g_CLI.pfnRemoveEvent(hContact, 1); CLISTEVENT cle = {}; cle.hContact = hContact; @@ -209,7 +209,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_TYPING); cle.pszService = MS_MSG_READMESSAGE; cle.szTooltip.w = szTip; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); IcoLib_ReleaseIcon(cle.hIcon); } @@ -304,7 +304,7 @@ static void RestoreUnreadMessageAlerts(void) mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact)); cle.hContact = e->hContact; cle.hDbEvent = e->hEvent; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } } diff --git a/src/core/stdmsg/src/srmm.cpp b/src/core/stdmsg/src/srmm.cpp index 2cdff71f91..d5004f291b 100644 --- a/src/core/stdmsg/src/srmm.cpp +++ b/src/core/stdmsg/src/srmm.cpp @@ -26,8 +26,6 @@ void SplitmsgShutdown(void); CMPlugin g_plugin; -CLIST_INTERFACE *pcli; - ///////////////////////////////////////////////////////////////////////////////////////// PLUGININFOEX pluginInfoEx = { @@ -54,8 +52,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRMM, extern "C" int __declspec(dllexport) Load(void) { - pcli = Clist_GetInterface(); - Load_ChatModule(); return LoadSendRecvMessageModule(); } diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index b7cfae1650..8aa3608d1b 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -408,8 +408,8 @@ void CTabbedWindow::TabClicked() if (s->wState & GC_EVENT_HIGHLIGHT) { s->wState &= ~GC_EVENT_HIGHLIGHT; - if (pcli->pfnGetEvent(s->hContact, 0)) - pcli->pfnRemoveEvent(s->hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(s->hContact, 0)) + g_CLI.pfnRemoveEvent(s->hContact, GC_FAKE_EVENT); } FixTabIcons(pDlg); -- cgit v1.2.3