summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/delphi/m_clist.inc43
-rw-r--r--include/m_clist.h24
-rw-r--r--plugins/Alarms/src/alarmlist.cpp2
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp16
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp2
-rw-r--r--plugins/Clist_nicer/src/clistevents.cpp2
-rw-r--r--plugins/ContactsPlus/src/main.cpp2
-rw-r--r--plugins/FileAsMessage/src/dialog.cpp6
-rw-r--r--plugins/GmailNotifier/src/main.cpp2
-rw-r--r--plugins/GmailNotifier/src/notify.cpp11
-rw-r--r--plugins/HistoryPlusPlus/hpp_externalgrid.pas2
-rw-r--r--plugins/IEView/src/HTMLBuilder.cpp2
-rw-r--r--plugins/KeyboardNotify/src/main.cpp8
-rw-r--r--plugins/MirandaG15/src/CAppletManager.cpp2
-rw-r--r--plugins/NewEventNotify/src/popup.cpp4
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp2
-rw-r--r--plugins/NotesAndReminders/src/main.cpp2
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp19
-rw-r--r--plugins/SMS/src/receive.cpp4
-rw-r--r--plugins/Scriver/src/chat/window.cpp12
-rw-r--r--plugins/Scriver/src/msgdialog.cpp2
-rw-r--r--plugins/Scriver/src/msglog.cpp2
-rw-r--r--plugins/Scriver/src/msgs.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp4
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp13
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp8
-rw-r--r--plugins/TabSRMM/src/mim.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp2
-rw-r--r--plugins/TabSRMM/src/msglog.cpp2
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp3
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp14
-rw-r--r--plugins/YAMN/src/main.cpp5
-rw-r--r--protocols/GTalkExt/src/GTalkExt.cpp2
-rw-r--r--protocols/GTalkExt/src/notifications.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp2
-rw-r--r--protocols/IRCG/src/clist.cpp6
-rw-r--r--protocols/IRCG/src/main.cpp2
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp3
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp2
-rw-r--r--protocols/MRA/src/Mra_functions.cpp4
-rw-r--r--protocols/MSN/src/msn_mail.cpp10
-rw-r--r--protocols/MSN/src/msn_menu.cpp3
-rw-r--r--protocols/MSN/src/msn_misc.cpp5
-rw-r--r--protocols/MSN/src/msn_svcs.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_trouter.cpp12
-rw-r--r--protocols/Tox/src/tox_multimedia.cpp3
-rw-r--r--protocols/VKontakte/src/misc.cpp4
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp3
-rw-r--r--src/core/stdauth/src/auth.cpp4
-rw-r--r--src/core/stdauth/src/main.cpp2
-rw-r--r--src/core/stdchat/src/window.cpp12
-rw-r--r--src/core/stdfile/src/file.cpp11
-rw-r--r--src/core/stdmsg/src/msglog.cpp2
-rw-r--r--src/core/stdmsg/src/msgs.cpp2
-rw-r--r--src/core/stduseronline/src/useronline.cpp4
-rw-r--r--src/mir_app/src/chat_clist.cpp12
-rw-r--r--src/mir_app/src/chat_tools.cpp4
-rw-r--r--src/mir_app/src/clistevents.cpp9
59 files changed, 139 insertions, 220 deletions
diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc
index c625bb5f02..57f0f8440d 100644
--- a/include/delphi/m_clist.inc
+++ b/include/delphi/m_clist.inc
@@ -125,49 +125,6 @@ const
CLEF_UNICODE = 4; // set pszTooltip as unicode
CLEF_PROTOCOLGLOBAL = 8; // set event globally for protocol, hContact has to
// be NULL, lpszProtocol the protocol ID name to be set
- {
- wParam : 0
- lParam : Pointer to a TCLISTEVENT
- Affect : Add's an event to the list
- Notes : The service will flash TCLISTEVENT.hIcon, next to the
- contact, TCLISTEVENT.hContact
- -
- pszService is called is called wParam=hwndContactList,
- lParam=pointer to a TCLISTEVENT.
- -
- the TCLISTEVENT data is invalidated after this service returns
- so copy anything from it if required.
- -
- TCLISTEVENT.pszService will also be called if the user
- double clicks on the icon, at which point it will be removed
- from the contact lists queue automatically.
- -
- TCLISTEVENT.hContact and TCLISTEVENT.hDBEvent should be unique.
- }
- MS_CLIST_ADDEVENT:PAnsiChar = 'CList/AddEvent';
-
- {
- wParam : TMCONTACT
- lParam : TMEVENT
- Affect : Remove an event from the contact list queue
- Returns: 0 on success, [non zero] on failure
- }
- MS_CLIST_REMOVEEVENT:PAnsiChar = 'Clist/RemoveEvent';
-
- {
- wParam : TMCONTACT
- lParam : iEvent
- Affect : Get the details of an event in the queue, see notes
- Returns: A CLISTEVENT* or NULL(0) on failure
- Notes : Returns the iEvent'1st/2nd/3rd/nth elemented queried,
- e.g. iEvent=0 will get the event that will be returned if the
- user double clicks on that TMCONTACT
- -
- Use TMCONTACT=NULL, iEvent=0 for example to get the event
- the user will get if they double click on the tray.
- Version: v0.1.2.1+
- }
- MS_CLIST_GETEVENT:PAnsiChar = 'CList/GetEvent';
{
wParam : ControlID
diff --git a/include/m_clist.h b/include/m_clist.h
index 18b8961931..61b4f13322 100644
--- a/include/m_clist.h
+++ b/include/m_clist.h
@@ -201,9 +201,6 @@ typedef struct {
#define MS_CLIST_INVALIDATEDISPLAYNAME "CList/InvalidateDiplayName"
/////////////////////////////////////////////////////////////////////////////////////////
-// adds an event to the contact list's queue
-// wParam = 0
-// lParam = (LPARAM)(CLISTEVENT*)cle
// The contact list will flash hIcon next to the contact hContact (use NULL for
// a system message). szServiceName will be called when the user double clicks
// the icon, at which point the event will be removed from the contact list's
@@ -246,27 +243,6 @@ typedef struct {
#define CLEF_TCHAR 0 //will return char*, as usual
#endif
-#define MS_CLIST_ADDEVENT "CList/AddEvent"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// removes an event from the contact list's queue
-// wParam = (MCONTACT)hContact
-// lParam = (LPARAM)(HANDLE)hDbEvent
-// returns 0 if the event was successfully removed, or nonzero if the event
-// was not found
-#define MS_CLIST_REMOVEEVENT "Clist/RemoveEvent"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// gets the details of an event in the queue
-// wParam = (MCONTACT)hContact
-// lParam = iEvent
-// returns a CLISTEVENT* on success, NULL on failure
-// Returns the iEvent-th event from the queue for hContact, so iEvent = 0 will
-// get the event that will be got when the user clicks on that contact.
-// Use hContact = INVALID_HANDLE_VALUE to search over all contacts, so iEvent = 0
-// will get the event that will be got if the user clicks the systray icon.
-#define MS_CLIST_GETEVENT "CList/GetEvent"
-
/////////////////////////////////////////////////////////////////////////////////////////
// gets the image list with all the useful icons in it
// wParam = lParam = 0
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
diff --git a/protocols/GTalkExt/src/GTalkExt.cpp b/protocols/GTalkExt/src/GTalkExt.cpp
index 6d0eb2f435..506e59af32 100644
--- a/protocols/GTalkExt/src/GTalkExt.cpp
+++ b/protocols/GTalkExt/src/GTalkExt.cpp
@@ -28,6 +28,7 @@
#include "Version.h"
#include "inbox.h"
+CLIST_INTERFACE *pcli;
int hLangpack;
HICON g_hPopupIcon = 0;
@@ -79,6 +80,7 @@ LRESULT CALLBACK WndProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
+ mir_getCLI();
WNDCLASS cls = { 0 };
cls.lpfnWndProc = WndProc;
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp
index 6978e81507..9c0d1e409c 100644
--- a/protocols/GTalkExt/src/notifications.cpp
+++ b/protocols/GTalkExt/src/notifications.cpp
@@ -70,13 +70,13 @@ void MarkEventRead(MCONTACT hCnt, MEVENT hEvt)
ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) &&
ReadCheckbox(0, IDC_MARKEVENTREAD, settings) &&
db_event_markRead(hCnt, hEvt) != -1)
- CallService(MS_CLIST_REMOVEEVENT, hCnt, hEvt);
+ pcli->pfnRemoveEvent(hCnt, hEvt);
}
int OnEventDeleted(WPARAM hContact, LPARAM hDbEvent, LPARAM wnd)
{
if (db_get_b((MCONTACT)hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) {
- CallService(MS_CLIST_REMOVEEVENT, hContact, hDbEvent);
+ pcli->pfnRemoveEvent(hContact, hDbEvent);
PostMessage((HWND)wnd, EVENT_DELETED_MSG, hContact, hDbEvent);
}
@@ -116,7 +116,7 @@ LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (ppdh->MarkRead && ppdh->hDbEvent && (acc = GetJidAcc(ppdh->jid))) {
ReadNotificationSettings(acc);
MarkEventRead(ppdh->hContact, ppdh->hDbEvent);
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)ppdh->hContact, (LPARAM)ppdh->hDbEvent);
+ pcli->pfnRemoveEvent(ppdh->hContact, ppdh->hDbEvent);
}
RemoveProp(wnd, PLUGIN_DATA_PROP_NAME);
free(ppdh);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index 3f8c63cdd3..a73ffa447d 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -1017,7 +1017,7 @@ retry:
cle.lParam = (LPARAM)img;
cle.pszService = service;
cle.pszTooltip = Translate("Incoming image");
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
ReleaseIconEx("image", FALSE);
}
}
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index cd52f2297f..22be4d9471 100644
--- a/protocols/IRCG/src/clist.cpp
+++ b/protocols/IRCG/src/clist.cpp
@@ -73,9 +73,9 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask,
cle.ptszTooltip = szNick;
cle.lParam = (LPARAM)pdci;
- if (CallService(MS_CLIST_GETEVENT, hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, hContact, -100);
- CallService(MS_CLIST_ADDEVENT, hContact, (LPARAM)&cle);
+ if (pcli->pfnGetEvent(hContact, 0))
+ pcli->pfnRemoveEvent(hContact, -100);
+ pcli->pfnAddEvent(&cle);
}
return TRUE;
}
diff --git a/protocols/IRCG/src/main.cpp b/protocols/IRCG/src/main.cpp
index accf27a448..549e9dc8ed 100644
--- a/protocols/IRCG/src/main.cpp
+++ b/protocols/IRCG/src/main.cpp
@@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "version.h"
+CLIST_INTERFACE *pcli;
HINSTANCE hInst = NULL;
int hLangpack;
@@ -89,6 +90,7 @@ static int ircProtoUninit(CIrcProto *ppro)
extern "C" int __declspec(dllexport) Load()
{
mir_getLP(&pluginInfo);
+ mir_getCLI();
InitIcons();
InitServers();
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 53c9ef9f72..2a7a706a50 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -458,7 +458,7 @@ BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams)
cle.lParam = (LPARAM)pParams;
cle.pszService = szService;
cle.ptszTooltip = TranslateT("Http authentication request received");
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index dffac55378..00ab589b8c 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -786,8 +786,7 @@ bool CJabberProto::OnIncomingNote(const TCHAR *szFrom, HXML hXml)
cle.lParam = (LPARAM)pItem;
cle.pszService = szService;
cle.ptszTooltip = TranslateT("Incoming note");
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
-
+ pcli->pfnAddEvent(&cle);
return true;
}
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 1e95257ab2..caef4f795d 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -603,7 +603,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
db_event_markRead(hContact, hDbEvent);
if (bRemoveCListEvents)
- CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)hDbEvent);
+ pcli->pfnRemoveEvent(hContact, hDbEvent);
}
}
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index f63e04ecf9..26b6ddd8ae 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -670,7 +670,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &
memcpy(pszServiceFunctionName, MRA_GOTO_INBOX, sizeof(MRA_GOTO_INBOX));
cle.pszService = szServiceFunction;
}
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
SkinPlaySound(szNewMailSound);
@@ -683,7 +683,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA &
else {
if ( !force_display && getByte("IncrementalNewMailNotify", MRA_DEFAULT_INC_NEW_MAIL_NOTIFY)) {
if (bTrayIconNewMailNotify)
- CallService(MS_CLIST_REMOVEEVENT, 0, (LPARAM)m_szModuleName);
+ pcli->pfnRemoveEvent(0, (LPARAM)m_szModuleName);
PUDeletePopup(hWndEMailPopupStatus);
hWndEMailPopupStatus = NULL;
}
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp
index 6723946566..99ea736122 100644
--- a/protocols/MSN/src/msn_mail.cpp
+++ b/protocols/MSN/src/msn_mail.cpp
@@ -282,21 +282,21 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial)
MCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail);
if (hContact) {
- CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)1);
+ pcli->pfnRemoveEvent(hContact, 1);
displayEmailCount(hContact);
if (ShowPopup && !getByte("DisableHotmailTray", 1)) {
+ char buf[64];
+ mir_snprintf(buf, "%s%s", m_szModuleName, MS_GOTO_INBOX);
+
CLISTEVENT cle = {};
cle.hContact = hContact;
cle.hDbEvent = 1;
cle.flags = CLEF_URGENT | CLEF_TCHAR;
cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_SENDEMAIL);
cle.ptszTooltip = tBuffer2;
- char buf[64];
- mir_snprintf(buf, "%s%s", m_szModuleName, MS_GOTO_INBOX);
cle.pszService = buf;
-
- CallService(MS_CLIST_ADDEVENT, hContact, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index 396e7803da..d607bb1dbb 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -48,7 +48,8 @@ INT_PTR CMsnProto::MsnBlockCommand(WPARAM hContact, LPARAM)
INT_PTR CMsnProto::MsnGotoInbox(WPARAM, LPARAM)
{
MCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail);
- if (hContact) CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)1);
+ if (hContact)
+ pcli->pfnRemoveEvent(hContact, 1);
MsnInvokeMyURL(true, "http://mail.live.com?rru=inbox");
return 0;
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index c170355e62..3ac46a9223 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -943,7 +943,8 @@ void HandlePopupData(PopupData *tData) {
if (tData != NULL) {
if (tData->flags & MSN_HOTMAIL_POPUP) {
MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
- if (hContact) CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)1);
+ if (hContact)
+ pcli->pfnRemoveEvent(hContact, 1);
if (tData->flags & MSN_ALLOW_ENTER)
tData->proto->MsnInvokeMyURL(true, tData->url);
}
@@ -956,7 +957,7 @@ void RemovePopupData(PopupData *tData) {
if (tData != NULL && (tData->flags & MSN_HOTMAIL_POPUP)) {
MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, NULL);
if (hContact)
- CallService(MS_CLIST_REMOVEEVENT, hContact, 1);
+ pcli->pfnRemoveEvent(hContact, 1);
}
}
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp
index 70a49450bd..502ed01b46 100644
--- a/protocols/MSN/src/msn_svcs.cpp
+++ b/protocols/MSN/src/msn_svcs.cpp
@@ -393,7 +393,7 @@ int CMsnProto::OnContactDeleted(WPARAM hContact, LPARAM)
else {
char szEmail[MSN_MAX_EMAIL_LEN];
if (MSN_IsMeByContact(hContact, szEmail))
- CallService(MS_CLIST_REMOVEEVENT, hContact, 1);
+ pcli->pfnRemoveEvent(hContact, 1);
if (szEmail[0]) {
debugLogA("Deleted Handler Email");
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp
index 933747d290..e7b1057a49 100644
--- a/protocols/SkypeWeb/src/skype_trouter.cpp
+++ b/protocols/SkypeWeb/src/skype_trouter.cpp
@@ -210,8 +210,7 @@ void CSkypeProto::OnTrouterEvent(const JSONNode &body, const JSONNode &)
CMString tooltip(FORMAT, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = tooltip.GetBuffer();
-
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
ShowNotification(pcli->pfnGetContactDisplayName(hContact, 0), TranslateT("Incoming call"), hContact, SKYPE_DB_EVENT_TYPE_INCOMING_CALL);
}
@@ -234,12 +233,9 @@ INT_PTR CSkypeProto::OnIncomingCallCLE(WPARAM, LPARAM lParam)
INT_PTR CSkypeProto::OnIncomingCallPP(WPARAM wParam, LPARAM hContact)
{
- CLISTEVENT *cle = NULL;
- while ((cle = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, hContact, 0)))
- {
- if (cle->lParam == SKYPE_DB_EVENT_TYPE_INCOMING_CALL)
- {
- CallService(MS_CLIST_REMOVEEVENT, hContact, cle->hDbEvent);
+ while (CLISTEVENT *cle = pcli->pfnGetEvent(hContact, 0)) {
+ if (cle->lParam == SKYPE_DB_EVENT_TYPE_INCOMING_CALL) {
+ pcli->pfnRemoveEvent(hContact, cle->hDbEvent);
break;
}
}
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp
index 9bd2aefb41..0ef2cec23a 100644
--- a/protocols/Tox/src/tox_multimedia.cpp
+++ b/protocols/Tox/src/tox_multimedia.cpp
@@ -358,8 +358,7 @@ INT_PTR CToxProto::OnRecvAudioCall(WPARAM hContact, LPARAM lParam)
char szService[MAX_PATH];
mir_snprintf(szService, "%s/Audio/Ring", GetContactProto(hContact));
cle.pszService = szService;
-
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
return hEvent;
}
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index ca29e5bb6d..16a207c66a 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -683,10 +683,10 @@ void CVkProto::MarkDialogAsRead(MCONTACT hContact)
MCONTACT hMContact = db_mc_tryMeta(hContact);
while ((hDBEvent = db_event_firstUnread(hContact)) != NULL) {
db_event_markRead(hContact, hDBEvent);
- int res1 = CallService(MS_CLIST_REMOVEEVENT, hMContact, hDBEvent);
+ int res1 = pcli->pfnRemoveEvent(hMContact, hDBEvent);
int res2 = 2;
if (hContact != hMContact)
- res2 = CallService(MS_CLIST_REMOVEEVENT, hContact, hDBEvent);
+ res2 = pcli->pfnRemoveEvent(hContact, hDBEvent);
debugLogA("CVkProto::MarkDialogAsRead [1] result = (%d, %d), hDbEvent = %d", res1, res2, (int)hDBEvent);
}
}
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index 83c1e2b18e..e78cb3ca5e 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -87,8 +87,7 @@ void CVkProto::AddCListEvent(bool bNews)
TCHAR toolTip[255];
mir_sntprintf(toolTip, bNews ? TranslateT("New news") : TranslateT("New notifications"));
cle.ptszTooltip = toolTip;
-
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp
index 1358e7858c..adb4577ab3 100644
--- a/src/core/stdauth/src/auth.cpp
+++ b/src/core/stdauth/src/auth.cpp
@@ -93,7 +93,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam)
cli.hIcon = Skin_LoadIcon(SKINICON_AUTH_REQUEST);
cli.pszService = MS_AUTH_SHOWREQUEST;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cli);
+ pcli->pfnAddEvent(&cli);
}
else if (dbei.eventType == EVENTTYPE_ADDED) {
SkinPlaySound("AddedEvent");
@@ -104,7 +104,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam)
cli.hIcon = Skin_LoadIcon(SKINICON_AUTH_ADD);
cli.pszService = MS_AUTH_SHOWADDED;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cli);
+ pcli->pfnAddEvent(&cli);
}
return 0;
}
diff --git a/src/core/stdauth/src/main.cpp b/src/core/stdauth/src/main.cpp
index f5f9e27d74..bfda91b735 100644
--- a/src/core/stdauth/src/main.cpp
+++ b/src/core/stdauth/src/main.cpp
@@ -23,6 +23,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
int LoadSendRecvAuthModule(void);
+CLIST_INTERFACE *pcli;
HINSTANCE hInst;
int hLangpack;
@@ -56,6 +57,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRAUTH
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
+ mir_getCLI();
LoadSendRecvAuthModule();
return 0;
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp
index fec7afd472..00abe9297a 100644
--- a/src/core/stdchat/src/window.cpp
+++ b/src/core/stdchat/src/window.cpp
@@ -1734,8 +1734,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (s->wState & GC_EVENT_HIGHLIGHT) {
s->wState &= ~GC_EVENT_HIGHLIGHT;
- if (CallService(MS_CLIST_GETEVENT, (WPARAM)s->hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)s->hContact, (LPARAM)GC_FAKE_EVENT);
+ if (pcli->pfnGetEvent(s->hContact, 0))
+ pcli->pfnRemoveEvent(s->hContact, GC_FAKE_EVENT);
}
SendMessage(hwndDlg, GC_FIXTABICONS, 0, (LPARAM)s);
@@ -1914,8 +1914,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
db_set_dw(si->hContact, CHAT_MODULE, "roomwidth", si->iWidth);
db_set_dw(si->hContact, CHAT_MODULE, "roomheight", si->iHeight);
}
- if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)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);
@@ -2087,8 +2087,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
FlashWindow(hwndDlg, FALSE);
if (db_get_w(si->hContact, si->pszModule, "ApparentMode", 0) != 0)
db_set_w(si->hContact, si->pszModule, "ApparentMode", (LPARAM)0);
- if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->hContact, (LPARAM)GC_FAKE_EVENT);
+ if (pcli->pfnGetEvent(si->hContact, 0))
+ pcli->pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
}
break;
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index 752c1f1fae..33d6a5df66 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -128,7 +128,7 @@ void PushFileEvent(MCONTACT hContact, MEVENT hdbe, LPARAM lParam)
cle.flags |= CLEF_TCHAR;
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_FILE);
cle.pszService = "SRFile/RecvFile";
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
}
}
@@ -321,14 +321,9 @@ static int SRFileProtoAck(WPARAM, LPARAM lParam)
if (ack->type != ACKTYPE_FILE) return 0;
int iEvent = 0;
- CLISTEVENT *cle = NULL;
- while ((cle = (CLISTEVENT*)CallService(MS_CLIST_GETEVENT, ack->hContact, iEvent++)) != NULL)
- {
+ while (CLISTEVENT *cle = pcli->pfnGetEvent(ack->hContact, iEvent++))
if (cle->lParam == (LPARAM)ack->hProcess)
- {
- CallService(MS_CLIST_REMOVEEVENT, ack->hContact, cle->hDbEvent);
- }
- }
+ pcli->pfnRemoveEvent(ack->hContact, cle->hDbEvent);
return 0;
}
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp
index 66ae2ab483..29ab6af1f9 100644
--- a/src/core/stdmsg/src/msglog.cpp
+++ b/src/core/stdmsg/src/msglog.cpp
@@ -221,7 +221,7 @@ static char* CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, MEVENT
}
if (!(dbei.flags & DBEF_SENT) && (dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) {
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/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index ebb815c423..aeeaceb504 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -58,7 +58,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
if (dbei.flags & (DBEF_SENT | DBEF_READ) || !(dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)))
return 0;
- CallServiceSync(MS_CLIST_REMOVEEVENT, hContact, 1);
+ pcli->pfnRemoveEvent(hContact, 1);
/* does a window for the contact exist? */
HWND hwnd = WindowList_Find(g_dat.hMessageWindowList, hContact);
if (hwnd) {
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp
index 12f7cda357..20ba0e68cf 100644
--- a/src/core/stduseronline/src/useronline.cpp
+++ b/src/core/stduseronline/src/useronline.cpp
@@ -47,7 +47,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam)
int lastEvent = (int)db_get_dw(hContact, "UserOnline", "LastEvent", 0);
if (lastEvent) {
- CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)lastEvent);
+ pcli->pfnRemoveEvent(hContact, lastEvent);
db_set_dw(hContact, "UserOnline", "LastEvent", 0);
}
}
@@ -67,7 +67,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam)
cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_USERONLINE, false);
cle.pszService = "UserOnline/Description";
cle.ptszTooltip = tooltip;
- CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
+ pcli->pfnAddEvent(&cle);
IcoLib_ReleaseIcon(cle.hIcon, 0);
db_set_dw(cle.hContact, "UserOnline", "LastEvent", (DWORD)cle.hDbEvent);
SkinPlaySound("UserOnline");
diff --git a/src/mir_app/src/chat_clist.cpp b/src/mir_app/src/chat_clist.cpp
index 267fca44d5..62c313c8b2 100644
--- a/src/mir_app/src/chat_clist.cpp
+++ b/src/mir_app/src/chat_clist.cpp
@@ -121,7 +121,7 @@ int RoomDoubleclicked(WPARAM hContact, LPARAM)
// is the "toggle visibility option set, so we need to close the window?
if (si->hWnd != NULL &&
db_get_b(NULL, CHAT_MODULE, "ToggleVisibility", 0) == 1 &&
- !CallService(MS_CLIST_GETEVENT, hContact, 0) &&
+ !cli.pfnGetEvent(hContact, 0) &&
IsWindowVisible(si->hWnd) && !IsIconic(si->hWnd))
{
if (chatApi.OnDblClickSession)
@@ -220,13 +220,13 @@ BOOL AddEvent(MCONTACT hContact, HICON hIcon, MEVENT hEvent, int type, TCHAR* fm
cle.pszService = "GChat/DblClickEvent" ;
cle.ptszTooltip = TranslateTS(szBuf);
if (type) {
- if (!CallService(MS_CLIST_GETEVENT, hContact, 0))
- CallService(MS_CLIST_ADDEVENT, hContact, (LPARAM)&cle);
+ if (!cli.pfnGetEvent(hContact, 0))
+ cli.pfnAddEvent(&cle);
}
else {
- if (CallService(MS_CLIST_GETEVENT, hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, hContact, (LPARAM)GC_FAKE_EVENT);
- CallService(MS_CLIST_ADDEVENT, hContact, (LPARAM)&cle);
+ if (cli.pfnGetEvent(hContact, 0))
+ cli.pfnRemoveEvent(hContact, GC_FAKE_EVENT);
+ cli.pfnAddEvent(&cle);
}
return TRUE;
}
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index 5d8e7c7dfa..2497dabec7 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -151,8 +151,8 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
case WM_CONTEXTMENU:
SESSION_INFO *si = (SESSION_INFO*)PUGetPluginData(hWnd);
if (si->hContact)
- if (CallService(MS_CLIST_GETEVENT, (WPARAM)si->hContact, 0))
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM)si->hContact, (LPARAM)GC_FAKE_EVENT);
+ if (cli.pfnGetEvent(si->hContact, 0))
+ cli.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
if (si->hWnd && KillTimer(si->hWnd, TIMERID_FLASHWND))
FlashWindow(si->hWnd, FALSE);
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp
index 2d7e90aaa2..7ed8ef4485 100644
--- a/src/mir_app/src/clistevents.cpp
+++ b/src/mir_app/src/clistevents.cpp
@@ -376,11 +376,6 @@ static int CListEventSettingsChanged(WPARAM hContact, LPARAM lParam)
/***************************************************************************************/
-INT_PTR AddEventSyncStub(WPARAM wParam, LPARAM lParam) { return CallServiceSync(MS_CLIST_ADDEVENT"_SYNC", wParam, lParam); }
-INT_PTR AddEventStub(WPARAM, LPARAM lParam) { return cli.pfnAddEvent((CLISTEVENT*)lParam) == NULL; }
-INT_PTR RemoveEventStub(WPARAM wParam, LPARAM lParam) { return cli.pfnRemoveEvent(wParam, lParam); }
-INT_PTR GetEventStub(WPARAM wParam, LPARAM lParam) { return (INT_PTR)cli.pfnGetEvent(wParam, (int)lParam); }
-
int InitCListEvents(void)
{
memset(&cli.events, 0, sizeof(cli.events));
@@ -388,10 +383,6 @@ int InitCListEvents(void)
disableTrayFlash = db_get_b(NULL, "CList", "DisableTrayFlash", 0);
disableIconFlash = db_get_b(NULL, "CList", "NoIconBlink", 0);
- CreateServiceFunction(MS_CLIST_ADDEVENT, AddEventSyncStub); //need to be called through sync to keep flash timer workable
- CreateServiceFunction(MS_CLIST_ADDEVENT"_SYNC", AddEventStub);
- CreateServiceFunction(MS_CLIST_REMOVEEVENT, RemoveEventStub);
- CreateServiceFunction(MS_CLIST_GETEVENT, GetEventStub);
HookEvent(ME_DB_CONTACT_DELETED, RemoveEventsForContact);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, CListEventSettingsChanged);
return 0;