diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-23 23:29:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-23 23:29:25 +0300 |
commit | 176e52e14fd0358a7f26ca8d7b0205244dfde2e7 (patch) | |
tree | 10da2f8951d20103af0215c38d07ea96ba61c191 /plugins/TabSRMM/src | |
parent | 91b13500b47a51f3a284d9f409b7b8dac167a06d (diff) |
no need to initialize pcli variable in each plugin (only in Clist_*)
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r-- | plugins/TabSRMM/src/chat_tools.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_window.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/globals.cpp | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/hotkeyhandler.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/mim.cpp | 8 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msglog.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/srmm.cpp | 3 |
9 files changed, 19 insertions, 22 deletions
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index 79bc186c61..180fa5d386 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -38,8 +38,8 @@ static void __stdcall Chat_DismissPopup(void *pi) {
SESSION_INFO *si = (SESSION_INFO*)pi;
if (si->hContact)
- if (pcli->pfnGetEvent(si->hContact, 0))
- pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ if (g_CLI.pfnGetEvent(si->hContact, 0))
+ g_CLI.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
if (si->pDlg && KillTimer(si->pDlg->GetHwnd(), TIMERID_FLASHWND))
FlashWindow(si->pDlg->GetHwnd(), FALSE);
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 88f561d7be..49100fe14c 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -183,8 +183,8 @@ void CChatRoomDlg::UpdateWindowState(UINT msg) if (m_iTabID >= 0) { if (db_get_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0) != 0) db_set_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0); - if (pcli->pfnGetEvent(m_si->hContact, 0)) - pcli->pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(m_si->hContact, 0)) + g_CLI.pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); UpdateTitle(); m_hTabIcon = m_hTabStatusIcon; @@ -581,8 +581,8 @@ void CChatRoomDlg::OnDestroy() if (m_nTypeMode == PROTOTYPE_SELFTYPING_ON) DM_NotifyTyping(PROTOTYPE_SELFTYPING_OFF); - if (pcli->pfnGetEvent(m_si->hContact, 0)) - pcli->pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); + if (g_CLI.pfnGetEvent(m_si->hContact, 0)) + g_CLI.pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT); m_si->wState &= ~STATE_TALK; m_si->pDlg = nullptr; m_si = nullptr; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index b581b21121..0799699983 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -111,7 +111,7 @@ void CGlobals::reloadSystemModulesChanged() }
else db_set_b(0, SRMSGMOD_T, "ieview_installed", 0);
- m_hwndClist = pcli->hwndContactList;
+ m_hwndClist = g_CLI.hwndContactList;
g_bPopupAvail = ServiceExists(MS_POPUP_ADDPOPUPT) != 0;
@@ -528,7 +528,7 @@ void CGlobals::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/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 89d3f904ad..4df021f7a5 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -143,7 +143,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_HOTKEY:
{
- CLISTEVENT *cli = pcli->pfnGetEvent(-1, 0);
+ CLISTEVENT *cli = g_CLI.pfnGetEvent(-1, 0);
if (cli != nullptr) {
if (strncmp(cli->pszService, MS_MSG_TYPINGMESSAGE, mir_strlen(cli->pszService))) {
CallService(cli->pszService, 0, (LPARAM)cli);
@@ -337,11 +337,11 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (lParam == 0)
HandleMenuEntryFromhContact(wParam);
else {
- CLISTEVENT *cle = pcli->pfnGetEvent(wParam, 0);
+ CLISTEVENT *cle = g_CLI.pfnGetEvent(wParam, 0);
if (cle) {
if (ServiceExists(cle->pszService)) {
CallService(cle->pszService, 0, (LPARAM)cle);
- pcli->pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ g_CLI.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
// still, we got that message posted.. the event may be waiting in tabSRMMs tray...
@@ -380,7 +380,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case DM_REMOVECLISTEVENT:
// sent from the popup to "dismiss" the event. we should do this in the main thread
- pcli->pfnRemoveEvent(wParam, lParam);
+ g_CLI.pfnRemoveEvent(wParam, lParam);
db_event_markRead(wParam, lParam);
return 0;
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index e7ca3940e3..d64e729331 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -276,7 +276,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) Clist_TrayNotifyW(nullptr, TranslateT("Typing notification"), szTip, NIIF_INFO, 1000 * 4); if (fShowOnClist) { - pcli->pfnRemoveEvent(hContact, 1); + g_CLI.pfnRemoveEvent(hContact, 1); CLISTEVENT cle = {}; cle.hContact = hContact; @@ -285,7 +285,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode) cle.hIcon = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]; cle.pszService = MS_MSG_TYPINGMESSAGE; cle.szTooltip.w = szTip; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } } return 0; @@ -390,7 +390,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) if (dbei.markedRead() || (isCustomEvent && !isShownCustomEvent)) return 0; - pcli->pfnRemoveEvent(hContact, 1); + g_CLI.pfnRemoveEvent(hContact, 1); bool bAllowAutoCreate = false; bool bAutoPopup = M.GetBool(SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP); @@ -518,7 +518,7 @@ nowindowcreate: contactName = Clist_GetContactDisplayName(hContact); mir_snwprintf(toolTip, TranslateT("Message from %s"), contactName); cle.szTooltip.w = toolTip; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, nullptr, nullptr, dbei.szModule); } diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 58b24b432f..725632bf14 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -277,7 +277,7 @@ void CSrmmWindow::MsgWindowUpdateState(UINT msg) if (m_dwFlagsEx & MWF_SHOW_FLASHCLIST) {
m_dwFlagsEx &= ~MWF_SHOW_FLASHCLIST;
if (m_hFlashingEvent != 0)
- pcli->pfnRemoveEvent(m_hContact, m_hFlashingEvent);
+ g_CLI.pfnRemoveEvent(m_hContact, m_hFlashingEvent);
m_hFlashingEvent = 0;
}
m_pContainer->dwFlags &= ~CNT_NEED_UPDATETITLE;
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index a72e879343..39ef10892e 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -778,7 +778,7 @@ void CTabBaseDlg::FlashOnClist(MEVENT hEvent, DBEVENTINFO *dbei) cle.hDbEvent = hEvent;
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = MS_MSG_READMESSAGE;
- pcli->pfnAddEvent(&cle);
+ g_CLI.pfnAddEvent(&cle);
m_dwFlagsEx |= MWF_SHOW_FLASHCLIST;
m_hFlashingEvent = hEvent;
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index e083b545fd..d275d001c1 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -482,7 +482,7 @@ static char* Template_CreateRTFFromDbEvent(CTabBaseDlg *dat, MCONTACT hContact, if (!isSent && (bIsStatusChangeEvent || dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) {
db_event_markRead(hContact, hDbEvent);
- pcli->pfnRemoveEvent(hContact, hDbEvent);
+ g_CLI.pfnRemoveEvent(hContact, hDbEvent);
}
g_groupBreak = TRUE;
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 2c4e0acfe3..22d4ace74c 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -35,7 +35,6 @@ LOGFONT lfDefault = { 0 }; */ CMPlugin g_plugin; -CLIST_INTERFACE *pcli; ///////////////////////////////////////////////////////////////////////////////////////// @@ -69,8 +68,6 @@ extern "C" int __declspec(dllexport) Load(void) return 1; } - pcli = Clist_GetInterface(); - SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfDefault), &lfDefault, FALSE); Chat_Load(); |