summaryrefslogtreecommitdiff
path: root/plugins/GmailNotifier
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/GmailNotifier')
-rw-r--r--plugins/GmailNotifier/src/main.cpp2
-rw-r--r--plugins/GmailNotifier/src/notify.cpp11
2 files changed, 8 insertions, 5 deletions
diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp
index 9a8cf8169d..60479823c0 100644
--- a/plugins/GmailNotifier/src/main.cpp
+++ b/plugins/GmailNotifier/src/main.cpp
@@ -10,6 +10,7 @@ There is no warranty.
#include "stdafx.h"
#include "version.h"
+CLIST_INTERFACE *pcli;
HINSTANCE hInst;
int hLangpack;
UINT hTimer;
@@ -88,6 +89,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
extern "C" int __declspec(dllexport) Load()
{
mir_getLP(&pluginInfoEx);
+ mir_getCLI();
SkinAddNewSoundEx("Gmail", LPGEN("Other"), LPGEN("Gmail: New thread(s)"));
HookEvent(ME_CLIST_DOUBLECLICKED, OpenBrowser);
diff --git a/plugins/GmailNotifier/src/notify.cpp b/plugins/GmailNotifier/src/notify.cpp
index b4991cfaa5..21f1115e77 100644
--- a/plugins/GmailNotifier/src/notify.cpp
+++ b/plugins/GmailNotifier/src/notify.cpp
@@ -6,7 +6,7 @@ int OpenBrowser(WPARAM hContact, LPARAM)
if (proto && !mir_strcmp(proto, MODULE_NAME)) {
Account *curAcc = GetAccountByContact(hContact);
PUDeletePopup(curAcc->popUpHwnd);
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)curAcc->hContact, (LPARAM)1);
+ pcli->pfnRemoveEvent(curAcc->hContact, 1);
if (GetKeyState(VK_SHIFT) >> 8 || optionWindowIsOpen)
return FALSE;
@@ -45,7 +45,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
case WM_CONTEXTMENU:
PUDeletePopup(hWnd);
curAcc->popUpHwnd = NULL;
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)hContact, (LPARAM)1);
+ pcli->pfnRemoveEvent(hContact, 1);
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
@@ -59,7 +59,7 @@ void NotifyUser(Account *curAcc)
switch (curAcc->results_num) {
case 0:
PUDeletePopup(curAcc->popUpHwnd);
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)curAcc->hContact, (LPARAM)1);
+ pcli->pfnRemoveEvent(curAcc->hContact, 1);
if (curAcc->oldResults_num != 0)
db_set_w(curAcc->hContact, MODULE_NAME, "Status", ID_STATUS_NONEW);
break;
@@ -87,6 +87,8 @@ void NotifyUser(Account *curAcc)
}
}
if (opt.notifierOnTray&&newMails > 0) {
+ pcli->pfnRemoveEvent(curAcc->hContact, 1);
+
CLISTEVENT cle = {};
cle.hContact = curAcc->hContact;
cle.hDbEvent = 1;
@@ -94,8 +96,7 @@ void NotifyUser(Account *curAcc)
cle.hIcon = Skin_LoadProtoIcon(MODULE_NAME, ID_STATUS_OCCUPIED);
cle.pszService = "GmailMNotifier/Notifying";
cle.pszTooltip = curAcc->results.next->content;
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)curAcc->hContact, (LPARAM)1);
- CallServiceSync(MS_CLIST_ADDEVENT, (WPARAM)curAcc->hContact, (LPARAM)& cle);
+ pcli->pfnAddEvent(&cle);
}
if (opt.notifierOnPop&&newMails > 0) {