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_*) --- plugins/GmailNotifier/src/main.cpp | 3 --- plugins/GmailNotifier/src/notify.cpp | 10 +++++----- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'plugins/GmailNotifier/src') diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index dd116e5f08..af7dfa44ec 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -11,7 +11,6 @@ There is no warranty. #include "version.h" CMPlugin g_plugin; -CLIST_INTERFACE *pcli; UINT hTimer; HANDLE hMirandaStarted, hOptionsInitial; @@ -87,8 +86,6 @@ static int OnMirandaStart(WPARAM, LPARAM) extern "C" int __declspec(dllexport) Load() { - pcli = Clist_GetInterface(); - g_plugin.addSound("Gmail", LPGENW("Other"), LPGENW("Gmail: New thread(s)")); HookEvent(ME_CLIST_DOUBLECLICKED, OpenBrowser); diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp index 359b39e926..dc34a05c23 100644 --- a/plugins/GmailNotifier/src/notify.cpp +++ b/plugins/GmailNotifier/src/notify.cpp @@ -77,7 +77,7 @@ int OpenBrowser(WPARAM hContact, LPARAM) if (proto && !mir_strcmp(proto, MODULENAME)) { Account *curAcc = GetAccountByContact(hContact); PUDeletePopup(curAcc->popUpHwnd); - pcli->pfnRemoveEvent(curAcc->hContact, 1); + g_CLI.pfnRemoveEvent(curAcc->hContact, 1); if (GetKeyState(VK_SHIFT) >> 8 || optionWindowIsOpen) return FALSE; @@ -118,7 +118,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_CONTEXTMENU: PUDeletePopup(hWnd); curAcc->popUpHwnd = nullptr; - pcli->pfnRemoveEvent(hContact, 1); + g_CLI.pfnRemoveEvent(hContact, 1); } return DefWindowProc(hWnd, message, wParam, lParam); } @@ -132,7 +132,7 @@ void NotifyUser(Account *curAcc) switch (curAcc->results_num) { case 0: PUDeletePopup(curAcc->popUpHwnd); - pcli->pfnRemoveEvent(curAcc->hContact, 1); + g_CLI.pfnRemoveEvent(curAcc->hContact, 1); if (curAcc->oldResults_num != 0) db_set_w(curAcc->hContact, MODULENAME, "Status", ID_STATUS_NONEW); break; @@ -160,7 +160,7 @@ void NotifyUser(Account *curAcc) } } if (opt.notifierOnTray&&newMails > 0) { - pcli->pfnRemoveEvent(curAcc->hContact, 1); + g_CLI.pfnRemoveEvent(curAcc->hContact, 1); CLISTEVENT cle = {}; cle.hContact = curAcc->hContact; @@ -169,7 +169,7 @@ void NotifyUser(Account *curAcc) cle.hIcon = Skin_LoadProtoIcon(MODULENAME, ID_STATUS_OCCUPIED); cle.pszService = "GmailMNotifier/Notifying"; cle.szTooltip.a = curAcc->results.next->content; - pcli->pfnAddEvent(&cle); + g_CLI.pfnAddEvent(&cle); } if (opt.notifierOnPop&&newMails > 0) { -- cgit v1.2.3