diff options
author | George Hazan <george.hazan@gmail.com> | 2016-01-28 16:04:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-01-28 16:04:16 +0000 |
commit | bb5aff746c50564ded61159c5ae28e6218d0a49d (patch) | |
tree | 0ec2ef5c4b6b6b9cf6c3bb4a606cf632e69b6d31 /plugins | |
parent | 1042a84dd1f01c249a946ec708d3dae2881ecfab (diff) |
another atavism removed: old stub services for clist events
git-svn-id: http://svn.miranda-ng.org/main/trunk@16181 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
30 files changed, 79 insertions, 80 deletions
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp index 1d394db194..c11ecba568 100644 --- a/plugins/Alarms/src/alarmlist.cpp +++ b/plugins/Alarms/src/alarmlist.cpp @@ -559,7 +559,7 @@ void DoAlarm(ALARM *alarm) cle.hIcon = hIconSystray;
cle.ptszTooltip = alarm->szTitle;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
}
}
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 17d334e030..4d892a16f8 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -166,14 +166,14 @@ LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa switch (message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
- CallServiceSync("BuddyExpectator/actionReturned", (WPARAM)PUGetContact(hWnd), 0);
+ pcli->pfnRemoveEvent(PUGetContact(hWnd), 0);
+ CallServiceSync("BuddyExpectator/actionReturned", PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
}
break;
case WM_CONTEXTMENU:
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
+ pcli->pfnRemoveEvent(PUGetContact(hWnd), 0);
setLastSeen(PUGetContact(hWnd));
PUDeletePopup(hWnd);
break;
@@ -191,14 +191,14 @@ LRESULT CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARA switch (message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
+ pcli->pfnRemoveEvent(PUGetContact(hWnd), 0);
CallServiceSync("BuddyExpectator/actionStillAbsent", (WPARAM)PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
}
break;
case WM_CONTEXTMENU:
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
+ pcli->pfnRemoveEvent(PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
break;
@@ -288,8 +288,7 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) TCHAR tmpMsg[512];
mir_sntprintf(tmpMsg, _T("%s %s"), nick, message);
cle.ptszTooltip = tmpMsg;
-
- CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
}
@@ -327,8 +326,7 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) mir_sntprintf(tmpMsg, _T("%s %s"), nick, message);
cle.ptszTooltip = tmpMsg;
cle.flags = CLEF_TCHAR;
-
- CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
}
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index d5b92c3624..038f6449e7 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -497,7 +497,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP // event we're interested in was removed by the service (nasty one...)
cle1 = MyGetEvent(iSelection);
if (cle1 != NULL)
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)cle->hContact, (LPARAM)cle->hDbEvent);
+ pcli->pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
}
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index 751964edb2..5db5463e11 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -163,7 +163,7 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa // event we're interested in was removed by the service (nasty one...)
cle1 = MyGetEvent(iSelection);
if (cle1 != NULL)
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)cle->hContact, (LPARAM)cle->hDbEvent);
+ pcli->pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
}
diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index 33ffa53e20..895b03daaf 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -83,7 +83,7 @@ static int HookDBEventAdded(WPARAM hContact, LPARAM hDbEvent) cle.pszService = MS_CONTACTS_RECEIVE;
cle.ptszTooltip = caToolTip;
cle.flags |= CLEF_UNICODE;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
return 0; //continue processing by other hooks
}
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp index 6a62142159..5c2329fcc5 100644 --- a/plugins/FileAsMessage/src/dialog.cpp +++ b/plugins/FileAsMessage/src/dialog.cpp @@ -71,7 +71,7 @@ static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM case WM_COMMAND:
{
PUDeletePopup(hWnd);
- CallService(MS_CLIST_REMOVEEVENT, hContact, 0);
+ pcli->pfnRemoveEvent(hContact, 0);
if (IsWindow(hDlg))
{
@@ -469,7 +469,7 @@ void FILEECHO::incomeRequest(char *param) cle.flags = CLEF_URGENT;
cle.hDbEvent = 0;
cle.pszService = SERVICE_NAME "/FERecvFile";
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
MakePopupMsg(hDlg, hContact, "Incoming file...");
}
@@ -546,7 +546,7 @@ void FILEECHO::onRecvTimer() if (db_get_b(NULL, "SRFile", "AutoClose", 0))
{
PostMessage(hDlg, WM_CLOSE, 0, 0);
- CallService(MS_CLIST_REMOVEEVENT, hContact, 0);
+ pcli->pfnRemoveEvent(hContact, 0);
}
SkinPlaySound("FileDone");
destroyTransfer();
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) {
diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas index 33199467c2..2bf5dd6c8c 100644 --- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas +++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas @@ -538,7 +538,7 @@ begin begin
if (not Item.IsRead) then
db_event_markRead(Items[Index].hContact, Items[Index].hDBEvent);
- CallService(MS_CLIST_REMOVEEVENT, Items[Index].hContact, Items[Index].hDBEvent);
+ cli^.pfnRemoveEvent(Items[Index].hContact, Items[Index].hDBEvent);
end
else if (not Item.IsRead) and (MessageTypesToDWord(Item.MessageType) and
MessageTypesToDWord([mtStatus, mtNickChange, mtAvatarChange]) > 0) then
diff --git a/plugins/IEView/src/HTMLBuilder.cpp b/plugins/IEView/src/HTMLBuilder.cpp index 69833aa9f8..8a84367ff5 100644 --- a/plugins/IEView/src/HTMLBuilder.cpp +++ b/plugins/IEView/src/HTMLBuilder.cpp @@ -297,7 +297,7 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event) db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & DBEF_SENT) && (dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_URL)) {
db_event_markRead(event->hContact, hDbEvent);
- CallService(MS_CLIST_REMOVEEVENT, event->hContact, (LPARAM)hDbEvent);
+ pcli->pfnRemoveEvent(event->hContact, hDbEvent);
}
if (!isDbEventShown(&dbei)) {
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index fe959dbc35..d54a584af7 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -28,6 +28,7 @@ HINSTANCE g_hInst; +CLIST_INTERFACE *pcli;
int hLangpack; DWORD IDThread = 0; @@ -257,7 +258,7 @@ BOOL checkUnopenEvents() if (nExternCount && bFlashOnOther) return TRUE; - for (nIndex = 0; pCLEvent = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, -1, nIndex); nIndex++) { + for (nIndex = 0; pCLEvent = pcli->pfnGetEvent(-1, nIndex); nIndex++) { DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact); if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg) || @@ -431,7 +432,7 @@ static VOID CALLBACK ReminderTimer(HWND, UINT, UINT_PTR, DWORD) return; } - for (nIndex = 0; !bReminderDisabled && (pCLEvent = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, -1, nIndex)); nIndex++) { + for (nIndex = 0; !bReminderDisabled && (pCLEvent = pcli->pfnGetEvent(-1, nIndex)); nIndex++) { DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact); if ((einfo.eventType == EVENTTYPE_MESSAGE && bFlashOnMsg) || @@ -813,7 +814,7 @@ void countUnopenEvents(int *msgCount, int *fileCount, int *urlCount, int *otherC int nIndex; CLISTEVENT *pCLEvent; - for (nIndex = 0; pCLEvent = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, -1, nIndex); nIndex++) { + for (nIndex = 0; pCLEvent = pcli->pfnGetEvent(-1, nIndex); nIndex++) { DBEVENTINFO einfo = readEventInfo(pCLEvent->hDbEvent, pCLEvent->hContact); if (metaCheckProtocol(einfo.szModule, pCLEvent->hContact, einfo.eventType)) { @@ -887,6 +888,7 @@ static int ModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfo); + mir_getCLI();
GetWindowsVersion(); OpenKeyboardDevice(); diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 037018765e..e5ffaffd22 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -821,7 +821,7 @@ bool CAppletManager::IsMessageWindowOpen(MCONTACT hContact) void CAppletManager::MarkMessageAsRead(MCONTACT hContact, MEVENT hEvent) { db_event_markRead(hContact, hEvent); - CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)hEvent); + pcli->pfnRemoveEvent(hContact, hEvent); } //************************************************************************ diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 089db2de2b..8cb098af19 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -85,7 +85,7 @@ int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA* pdata) return 0;
for (int idx = 0;; idx++) {
- CLISTEVENT *cle = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, (WPARAM)pdata->hContact, idx);
+ CLISTEVENT *cle = pcli->pfnGetEvent(pdata->hContact, idx);
if (cle == NULL)
break;
@@ -104,7 +104,7 @@ int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA* pdata) EVENT_DATA_EX *eventData = pdata->firstEventData;
pdata->iLock = 1;
while (eventData) {
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)pdata->hContact, (LPARAM)eventData->hEvent);
+ pcli->pfnRemoveEvent(pdata->hContact, eventData->hEvent);
db_event_markRead(pdata->hContact, eventData->hEvent);
eventData = eventData->next;
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 571870f566..22edad41c0 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -318,7 +318,7 @@ void BlinkIcon(MCONTACT hContact, HICON hIcon, TCHAR *stzText) cle.hIcon = hIcon;
cle.pszService = "UserOnline/Description";
cle.ptszTooltip = stzText;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
void PlayChangeSound(MCONTACT hContact, const char *name)
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index 0c54cd6626..67b3a00901 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -1,5 +1,6 @@ #include "globals.h"
+CLIST_INTERFACE *pcli;
HINSTANCE hinstance = NULL;
HINSTANCE hmiranda = NULL;
int hLangpack;
@@ -299,6 +300,7 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved) extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfo);
+ mir_getCLI();
hmiranda = GetModuleHandle(NULL);
INITCOMMONCONTROLSEX ctrls = {0};
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 87222c5e08..42f011736e 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -180,21 +180,14 @@ static REMINDERDATA* FindReminder(DWORD uid) static void RemoveReminderSystemEvent(REMINDERDATA *p)
{
- if (p->SystemEventQueued)
- {
- int i;
-
- for (i=0; ; i++)
- {
- CLISTEVENT *pev = (CLISTEVENT*) CallService(MS_CLIST_GETEVENT,(WPARAM)INVALID_HANDLE_VALUE,i);
+ if (p->SystemEventQueued) {
+ for (int i = 0; ; i++) {
+ CLISTEVENT *pev = pcli->pfnGetEvent(-1, i);
if (!pev)
break;
- if ((ULONG)pev->lParam == p->uid && !pev->hContact
- && pev->pszService && !mir_strcmp(pev->pszService, MODULENAME"/OpenTriggeredReminder"))
- {
- if ( !CallService(MS_CLIST_REMOVEEVENT,(WPARAM)pev->hContact,(LPARAM)pev->hDbEvent) )
- {
+ if ((ULONG)pev->lParam == p->uid && !pev->hContact && pev->pszService && !mir_strcmp(pev->pszService, MODULENAME"/OpenTriggeredReminder")) {
+ if (!pcli->pfnRemoveEvent(pev->hContact, pev->hDbEvent)) {
p->SystemEventQueued = FALSE;
if (QueuedReminderCount)
QueuedReminderCount--;
@@ -694,7 +687,7 @@ static void FireReminder(REMINDERDATA *pReminder, BOOL *pHasPlayedSound) ev.lParam = (LPARAM)pReminder->uid;
ev.pszService = MODULENAME"/OpenTriggeredReminder";
ev.pszTooltip = Translate("Reminder");
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&ev);
+ pcli->pfnAddEvent(&ev);
}
pReminder->SystemEventQueued = TRUE;
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index 766cca7866..fad6ded482 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -241,7 +241,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS);
cle.pszService = szServiceFunction;
cle.ptszTooltip = szToolTip;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
}
}
@@ -264,7 +264,7 @@ int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) cle.hIcon = (HICON)LoadImage(ssSMSSettings.hInstance, MAKEINTRESOURCE(iIcon), IMAGE_ICON, 0, 0, LR_SHARED);
cle.pszService = szServiceFunction;
cle.ptszTooltip = szToolTip;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
}
}
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index b67205598c..8f4cfbba59 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -1336,8 +1336,8 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR if (si->wState & GC_EVENT_HIGHLIGHT) {
si->wState &= ~GC_EVENT_HIGHLIGHT;
- if (CallService(MS_CLIST_GETEVENT, si->hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, si->hContact, (LPARAM)GC_FAKE_EVENT);
+ if (pcli->pfnGetEvent(si->hContact, 0))
+ pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
}
SendMessage(hwndDlg, GC_FIXTABICONS, 0, 0);
@@ -1464,8 +1464,8 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR return TRUE;
case SESSION_TERMINATE:
- if (CallService(MS_CLIST_GETEVENT, si->hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, si->hContact, (LPARAM)GC_FAKE_EVENT);
+ if (pcli->pfnGetEvent(si->hContact, 0))
+ pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
si->wState &= ~STATE_TALK;
db_set_w(si->hContact, si->pszModule, "ApparentMode", 0);
SendMessage(hwndDlg, GC_CLOSEWINDOW, 0, 0);
@@ -1584,8 +1584,8 @@ LABEL_SHOWWINDOW: if (db_get_w(si->hContact, si->pszModule, "ApparentMode", 0) != 0)
db_set_w(si->hContact, si->pszModule, "ApparentMode", 0);
- if (CallService(MS_CLIST_GETEVENT, si->hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, si->hContact, (LPARAM)GC_FAKE_EVENT);
+ if (pcli->pfnGetEvent(si->hContact, 0))
+ pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
break;
case WM_NOTIFY:
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 68e31b3ec1..b6c03cf06c 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1198,7 +1198,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & DBEF_SENT) && (DbEventIsMessageOrCustom(&dbei) || dbei.eventType == EVENTTYPE_URL))
- CallService(MS_CLIST_REMOVEEVENT, dat->hContact, (LPARAM)hDbEvent);
+ pcli->pfnRemoveEvent(dat->hContact, hDbEvent);
hDbEvent = db_event_next(dat->hContact, hDbEvent);
}
}
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 5915bf2acd..11e5469a30 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -167,7 +167,7 @@ EventData* getEventFromDB(SrmmWindowData *dat, MCONTACT hContact, MEVENT hDbEven evt->custom = DbEventIsCustomForMsgWindow(&dbei);
if (!(dbei.flags & DBEF_SENT) && (dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_URL || evt->custom)) {
db_event_markRead(hContact, hDbEvent);
- CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)hDbEvent);
+ pcli->pfnRemoveEvent(hContact, hDbEvent);
}
else if (dbei.eventType == EVENTTYPE_JABBER_CHATSTATES || dbei.eventType == EVENTTYPE_JABBER_PRESENCE)
db_event_markRead(hContact, hDbEvent);
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index e8cf42c21d..274ada90a9 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -105,7 +105,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) if (dbei.flags & DBEF_SENT || !DbEventIsMessageOrCustom(&dbei))
return 0;
- CallServiceSync(MS_CLIST_REMOVEEVENT, hContact, 1);
+ pcli->pfnRemoveEvent(hContact, 1);
/* does a window for the contact exist? */
if (hwnd == NULL) {
/* new message */
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index e357842be9..6e722c597b 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -46,8 +46,8 @@ static void __stdcall Chat_DismissPopup(void *pi) {
SESSION_INFO *si = (SESSION_INFO*)pi;
if (si->hContact)
- if (CallService(MS_CLIST_GETEVENT, si->hContact, 0))
- CallServiceSync(MS_CLIST_REMOVEEVENT, si->hContact, (LPARAM)GC_FAKE_EVENT);
+ if (pcli->pfnGetEvent(si->hContact, 0))
+ pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
if (si->hWnd && KillTimer(si->hWnd, TIMERID_FLASHWND))
FlashWindow(si->hWnd, FALSE);
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 152a9278d4..71d1aabbfe 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -202,8 +202,8 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg) if (dat->iTabID >= 0) { if (db_get_w(si->hContact, si->pszModule, "ApparentMode", 0) != 0) db_set_w(si->hContact, si->pszModule, "ApparentMode", 0); - if (CallService(MS_CLIST_GETEVENT, si->hContact, 0)) - CallService(MS_CLIST_REMOVEEVENT, si->hContact, (LPARAM)GC_FAKE_EVENT); + if (pcli->pfnGetEvent(si->hContact, 0)) + pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT); SendMessage(hwndDlg, GC_UPDATETITLE, 0, 1); dat->dwTickLastEvent = 0; @@ -2265,8 +2265,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar return TRUE; case SESSION_TERMINATE: - if (CallService(MS_CLIST_GETEVENT, si->hContact, 0)) - CallService(MS_CLIST_REMOVEEVENT, si->hContact, (LPARAM)GC_FAKE_EVENT); + if (pcli->pfnGetEvent(si->hContact, 0)) + pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT); si->wState &= ~STATE_TALK; dat->bWasDeleted = 1; @@ -3422,8 +3422,9 @@ LABEL_SHOWWINDOW: case WM_DESTROY: if (si == NULL) break; - if (CallService(MS_CLIST_GETEVENT, si->hContact, 0)) - CallService(MS_CLIST_REMOVEEVENT, si->hContact, GC_FAKE_EVENT); + + if (pcli->pfnGetEvent(si->hContact, 0)) + pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT); si->wState &= ~STATE_TALK; si->hWnd = NULL; si->dat = NULL; diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index ba25afd7fd..95f41152be 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -161,7 +161,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_HOTKEY:
{
- CLISTEVENT *cli = (CLISTEVENT *)CallService(MS_CLIST_GETEVENT, (WPARAM)INVALID_HANDLE_VALUE, 0);
+ CLISTEVENT *cli = pcli->pfnGetEvent(-1, 0);
if (cli != NULL) {
if (strncmp(cli->pszService, "SRMsg/TypingMessage", mir_strlen(cli->pszService))) {
CallService(cli->pszService, 0, (LPARAM)cli);
@@ -355,11 +355,11 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (lParam == 0)
HandleMenuEntryFromhContact(wParam);
else {
- CLISTEVENT *cle = (CLISTEVENT *)CallService(MS_CLIST_GETEVENT, wParam, 0);
+ CLISTEVENT *cle = pcli->pfnGetEvent(wParam, 0);
if (cle) {
if (ServiceExists(cle->pszService)) {
CallService(cle->pszService, 0, (LPARAM)cle);
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)cle->hContact, (LPARAM)cle->hDbEvent);
+ pcli->pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
// still, we got that message posted.. the event may be waiting in tabSRMMs tray...
@@ -419,7 +419,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // sent from the popup to "dismiss" the event. we should do this in the main thread
case DM_REMOVECLISTEVENT:
- CallService(MS_CLIST_REMOVEEVENT, wParam, lParam);
+ pcli->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 9febb58db2..0e2f691201 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -425,7 +425,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent) if (dbei.markedRead() || (isCustomEvent && !isShownCustomEvent)) return 0; - CallServiceSync(MS_CLIST_REMOVEEVENT, hContact, 1); + pcli->pfnRemoveEvent(hContact, 1); bool bAllowAutoCreate = false; bool bAutoPopup = M.GetBool(SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP); diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index a1b07a1f7a..a89ba8265a 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -295,7 +295,7 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg) if (dat->dwFlagsEx & MWF_SHOW_FLASHCLIST) {
dat->dwFlagsEx &= ~MWF_SHOW_FLASHCLIST;
if (dat->hFlashingEvent != 0)
- CallService(MS_CLIST_REMOVEEVENT, dat->hContact, (LPARAM)dat->hFlashingEvent);
+ pcli->pfnRemoveEvent(dat->hContact, dat->hFlashingEvent);
dat->hFlashingEvent = 0;
}
dat->pContainer->dwFlags &= ~CNT_NEED_UPDATETITLE;
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index 58ed380ce1..7280b095f6 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -451,7 +451,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, if (!isSent && (bIsStatusChangeEvent || dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) {
db_event_markRead(hContact, hDbEvent);
- CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)hDbEvent);
+ pcli->pfnRemoveEvent(hContact, hDbEvent);
}
g_groupBreak = TRUE;
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index ceddb9aaba..e1faebb4b5 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -335,8 +335,7 @@ static void NotifyFlashCListIcon(MCONTACT hContact, const CEvent &evt) // pszService = "dummy" get 'service not fount' and continue;
cle.pszService = "dummy";
cle.lParam = NULL;
-
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
/**
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp index 644c849372..ada976daa0 100644 --- a/plugins/YAMN/src/browser/mailbrowser.cpp +++ b/plugins/YAMN/src/browser/mailbrowser.cpp @@ -645,7 +645,7 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D evt.lParam = ActualAccount->hContact; evt.pszService = MS_YAMN_CLISTDBLCLICK; evt.pszTooltip = sMsg; - CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&evt); + pcli->pfnAddEvent(&evt); } db_set_s(ActualAccount->hContact, "CList", "StatusMsg", sMsg); @@ -687,9 +687,8 @@ void DoMailActions(HWND hDlg, HACCOUNT ActualAccount, struct CMailNumbers *MN, D } //and remove the event - if ((nflags & YAMN_ACC_CONT) && (!(nflags & YAMN_ACC_CONTNOEVENT)) && (MN->Real.UnSeen + MN->Virtual.UnSeen == 0)) { - CallService(MS_CLIST_REMOVEEVENT, (WPARAM)ActualAccount->hContact, (LPARAM)ActualAccount->hContact); - } + if ((nflags & YAMN_ACC_CONT) && (!(nflags & YAMN_ACC_CONTNOEVENT)) && (MN->Real.UnSeen + MN->Virtual.UnSeen == 0)) + pcli->pfnRemoveEvent(ActualAccount->hContact, ActualAccount->hContact); if ((MN->Real.BrowserUC + MN->Virtual.BrowserUC == 0) && (hDlg != NULL)) { if (!IsWindowVisible(hDlg) && !(nflags & YAMN_ACC_MSG)) @@ -864,9 +863,8 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa DebugLog(SynchroFile, "PopupProc:LEFTCLICK:ActualAccountSO-read enter failed\n"); #endif } - if ((Account->NewMailN.Flags & YAMN_ACC_CONT) && !(Account->NewMailN.Flags & YAMN_ACC_CONTNOEVENT)) { - CallService(MS_CLIST_REMOVEEVENT, hContact, hContact); - } + if ((Account->NewMailN.Flags & YAMN_ACC_CONT) && !(Account->NewMailN.Flags & YAMN_ACC_CONTNOEVENT)) + pcli->pfnRemoveEvent(hContact, hContact); } // fall through case WM_CONTEXTMENU: @@ -1709,7 +1707,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR SetTimer(hDlg, TIMER_FLASHING, 500, NULL); if (ActualAccount->hContact != NULL) - CallService(MS_CLIST_REMOVEEVENT, (WPARAM)ActualAccount->hContact, (LPARAM)"yamn new mail message"); + pcli->pfnRemoveEvent(ActualAccount->hContact, (LPARAM)"yamn new mail message"); mir_subclassWindow(GetDlgItem(hDlg, IDC_LISTMAILS), ListViewSubclassProc); } diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index 601e2b3653..c5df153172 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -27,9 +27,9 @@ HANDLE hAccountFolder; HINSTANCE *hDllPlugins; static int iDllPlugins = 0; - YAMN_VARIABLES YAMNVar; +CLIST_INTERFACE *pcli; int hLangpack; PLUGININFOEX pluginInfo = { @@ -369,6 +369,9 @@ static void UnloadPlugins() extern "C" int __declspec(dllexport) Unload(void) { + mir_getLP(&pluginInfo); + mir_getCLI(); + #ifdef _DEBUG UnInitDebug(); #endif |