summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/delphi/m_clist.inc5
-rw-r--r--include/delphi/m_clistint.inc38
-rw-r--r--include/m_clistint.h3
-rw-r--r--libs/win32/mir_app.libbin254990 -> 255540 bytes
-rw-r--r--libs/win64/mir_app.libbin252576 -> 253112 bytes
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp8
-rw-r--r--plugins/Clist_modern/src/init.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp20
-rw-r--r--plugins/Clist_modern/src/modern_commonprototypes.h2
-rw-r--r--plugins/Clist_nicer/src/clistevents.cpp23
-rw-r--r--plugins/Clist_nicer/src/init.cpp4
-rw-r--r--plugins/FileAsMessage/src/dialog.cpp4
-rw-r--r--plugins/HistoryPlusPlus/hpp_externalgrid.pas2
-rw-r--r--plugins/IEView/src/HTMLBuilder.cpp2
-rw-r--r--plugins/MirandaG15/src/CAppletManager.cpp2
-rw-r--r--plugins/NewEventNotify/src/popup.cpp2
-rw-r--r--plugins/NewStory/src/history_array.cpp2
-rw-r--r--plugins/NotesAndReminders/src/reminders.cpp2
-rw-r--r--plugins/Scriver/src/msgdialog.cpp6
-rw-r--r--plugins/Scriver/src/msgs.cpp2
-rw-r--r--plugins/TabSRMM/src/chat_tools.cpp2
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp4
-rw-r--r--plugins/TabSRMM/src/mim.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp4
-rw-r--r--plugins/TabSRMM/src/msglog.cpp2
-rw-r--r--plugins/VoiceService/src/VoiceCall.cpp2
-rw-r--r--protocols/GmailNotifier/src/notify.cpp8
-rw-r--r--protocols/ICQ-WIM/src/poll.cpp2
-rw-r--r--protocols/IRCG/src/clist.cpp2
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp2
-rw-r--r--protocols/VKontakte/src/misc.cpp4
-rw-r--r--protocols/YAMN/src/browser/mailbrowser.cpp6
-rw-r--r--src/core/stdfile/src/file.cpp2
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp2
-rw-r--r--src/core/stdmsg/src/msgs.cpp2
-rw-r--r--src/core/stdmsg/src/tabs.cpp2
-rw-r--r--src/core/stduseronline/src/useronline.cpp2
-rw-r--r--src/mir_app/src/chat_log.cpp2
-rw-r--r--src/mir_app/src/chat_manager.cpp2
-rw-r--r--src/mir_app/src/chat_svc.cpp2
-rw-r--r--src/mir_app/src/chat_tools.cpp4
-rw-r--r--src/mir_app/src/clc.h2
-rw-r--r--src/mir_app/src/clistcore.cpp2
-rw-r--r--src/mir_app/src/clistevents.cpp51
-rw-r--r--src/mir_app/src/clistsettings.cpp2
-rw-r--r--src/mir_app/src/mir_app.def2
-rw-r--r--src/mir_app/src/mir_app64.def2
-rw-r--r--src/mir_app/src/srmm_log_rtf.cpp2
49 files changed, 111 insertions, 143 deletions
diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc
index 89eb9ebcbd..195b19fbc5 100644
--- a/include/delphi/m_clist.inc
+++ b/include/delphi/m_clist.inc
@@ -93,6 +93,11 @@ const
function Clist_GetContactDisplayName(hContact:TMCONTACT; mode:int):PWideChar; stdcall; external AppDll;
{
+ removes an event
+ }
+ function Clist_RemoveEvent(hContact:TMCONTACT;hDbEvent:TMEVENT) : integer; stdcall; external AppDll;
+
+ {
wParam : 0
lParam : 0
Affect : Toggles the show/hide status of the contact list
diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc
index cd32d0f067..fa7db4320f 100644
--- a/include/delphi/m_clistint.inc
+++ b/include/delphi/m_clistint.inc
@@ -85,44 +85,6 @@ type
(* clistmod.c *)
pfnIconFromStatusMode : function (szProto:PAnsiChar; status:int; hContact:TMCONTACT):int; cdecl;
- pfnShowHide : procedure; cdecl;
-
- (* clistsettings.c *)
- pfnCreateCacheItem : procedure; cdecl;
- pfnCheckCacheItem : procedure; cdecl;
- pfnFreeCacheItem : procedure; cdecl;
-
- pfnInvalidateDisplayNameCacheEntry : procedure; cdecl;
-
- (* clisttray.c *)
- pfnTrayIconPauseAutoHide : procedure; cdecl;
- pfnTrayIconProcessMessage : procedure; cdecl;
-
- (* clui.c *)
- pfnContactListWndProc : procedure; cdecl;
-
- pfnCluiProtocolStatusChanged : procedure; cdecl;
- pfnLoadCluiGlobalOpts : procedure; cdecl;
- pfnInvalidateRect : procedure; cdecl;
- pfnOnCreateClc : procedure; cdecl;
-
- (* contact.c *)
- pfnCompareContacts : procedure; cdecl;
- pfnSetHideOffline : procedure; cdecl;
-
- (* docking.c *)
- pfnDocking_ProcessWindowMessage : procedure; cdecl;
-
- (*************************************************************************************
- * version 2 - events processing
- *************************************************************************************)
-
- bzzz : pointer;
-
- pfnAddEvent : procedure; cdecl;
- pfnGetEvent : procedure; cdecl;
-
- pfnRemoveEvent : function (hContact:TMCONTACT; hDbEvent:TMEVENT):int; cdecl;
end;
function Clist_GetInterface : PCLIST_INTERFACE; stdcall; external AppDll;
diff --git a/include/m_clistint.h b/include/m_clistint.h
index c38a3ff812..9f9bfa4a37 100644
--- a/include/m_clistint.h
+++ b/include/m_clistint.h
@@ -273,6 +273,7 @@ EXTERN_C MIR_APP_DLL(int) Clist_IsHiddenMode(ClcData *dat, int status);
EXTERN_C MIR_APP_DLL(void) Clist_LoadContactTree(void);
EXTERN_C MIR_APP_DLL(void) Clist_NotifyNewContact(HWND hwnd, MCONTACT hContact);
EXTERN_C MIR_APP_DLL(void) Clist_RecalculateGroupCheckboxes(ClcData *dat);
+EXTERN_C MIR_APP_DLL(int) Clist_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
EXTERN_C MIR_APP_DLL(ClcGroup*) Clist_RemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount);
EXTERN_C MIR_APP_DLL(void) Clist_SaveStateAndRebuildList(HWND hwnd, ClcData *dat);
EXTERN_C MIR_APP_DLL(void) Clist_SetGroupChildCheckboxes(ClcGroup *group, int checked);
@@ -397,7 +398,7 @@ struct CLIST_INTERFACE
CListEvent* (*pfnAddEvent)(CLISTEVENT*);
- int (*pfnRemoveEvent)(MCONTACT hContact, MEVENT hDbEvent);
+ int (*pfnFreeEvent)(CListEvent *);
int (*pfnGetImlIconIndex)(HICON hIcon);
/*************************************************************************************
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index e15d70e7d1..d5d7dc174e 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index ffa505ace7..13fef8c1be 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index 1a9285e4dc..641af4fbaf 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -163,14 +163,14 @@ LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
switch (message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
- g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
+ Clist_RemoveEvent(PUGetContact(hWnd), 0);
CallServiceSync("BuddyExpectator/actionReturned", PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
}
break;
case WM_CONTEXTMENU:
- g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
+ Clist_RemoveEvent(PUGetContact(hWnd), 0);
setLastSeen(PUGetContact(hWnd));
PUDeletePopup(hWnd);
break;
@@ -188,14 +188,14 @@ LRESULT CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARA
switch (message) {
case WM_COMMAND:
if (HIWORD(wParam) == STN_CLICKED) {
- g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
+ Clist_RemoveEvent(PUGetContact(hWnd), 0);
CallServiceSync("BuddyExpectator/actionStillAbsent", (WPARAM)PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
}
break;
case WM_CONTEXTMENU:
- g_clistApi.pfnRemoveEvent(PUGetContact(hWnd), 0);
+ Clist_RemoveEvent(PUGetContact(hWnd), 0);
PUDeletePopup(hWnd);
break;
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index 6e809c6b4b..851076a1c5 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -206,7 +206,7 @@ static HRESULT SubclassClistInterface()
g_clistApi.pfnContactListControlWndProc = cli_ContactListControlWndProc;
g_clistApi.pfnProcessExternalMessages = cli_ProcessExternalMessages;
g_clistApi.pfnAddEvent = cli_AddEvent;
- g_clistApi.pfnRemoveEvent = cli_RemoveEvent;
+ g_clistApi.pfnFreeEvent = cli_RemoveEvent;
g_clistApi.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
return S_OK;
}
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp
index e918bcee65..d0eb4753d2 100644
--- a/plugins/Clist_modern/src/modern_clistevents.cpp
+++ b/plugins/Clist_modern/src/modern_clistevents.cpp
@@ -155,19 +155,11 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle)
}
-int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
+int cli_RemoveEvent(CListEvent *pEvent)
{
- // Find the event that should be removed
- CListEvent *pEvent = nullptr;
- for (auto &it : *g_clistApi.events)
- if (it->hContact == hContact && it->hDbEvent == hDbEvent) {
- pEvent = it;
- break;
- }
-
- // Event was not found
- if (pEvent == nullptr)
- return 1;
+ // save variables because pEvent should be freed
+ auto hContact = pEvent->hContact;
+ auto hDbEvent = pEvent->hDbEvent;
// remove event from the notify menu
int iMenuId = pEvent->menuId;
@@ -184,7 +176,7 @@ int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
}
}
- int res = corecli.pfnRemoveEvent(hContact, hDbEvent);
+ int res = corecli.pfnFreeEvent(pEvent);
if (g_clistApi.events->getCount() == 0) {
g_CluiData.bNotifyActive = false;
@@ -407,7 +399,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 != nullptr)
- g_clistApi.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ Clist_RemoveEvent(cle->hContact, cle->hDbEvent);
}
}
}
diff --git a/plugins/Clist_modern/src/modern_commonprototypes.h b/plugins/Clist_modern/src/modern_commonprototypes.h
index 78cc984508..69c0264136 100644
--- a/plugins/Clist_modern/src/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/modern_commonprototypes.h
@@ -214,7 +214,7 @@ int cliGetGroupContentsCount(ClcGroup *group, int visibleOnly);
int cliFindRowByText(HWND hwnd, ClcData *dat, const wchar_t *text, int prefixOk);
int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact);
-int cli_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
+int cli_RemoveEvent(CListEvent *cle);
void cli_FreeContact(ClcContact*);
void cli_SetContactCheckboxes(ClcContact*, int);
LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp
index 134738fcff..08a48dcede 100644
--- a/plugins/Clist_nicer/src/clistevents.cpp
+++ b/plugins/Clist_nicer/src/clistevents.cpp
@@ -161,7 +161,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 != nullptr)
- g_clistApi.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ Clist_RemoveEvent(cle->hContact, cle->hDbEvent);
}
}
}
@@ -312,20 +312,8 @@ CListEvent* AddEvent(CLISTEVENT *cle)
// wParam=(MCONTACT)hContact
// lParam=(LPARAM)(HANDLE)hDbEvent
// Returns 0 if the event was successfully removed, or nonzero if the event was not found
-int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
+int RemoveEvent(CListEvent *e)
{
- // Find the event that should be removed
- CListEvent *e = nullptr;
- for (auto &it : *g_clistApi.events)
- if (it->hContact == hContact && it->hDbEvent == hDbEvent) {
- e = it;
- break;
- }
-
- // Event was not found
- if (e == nullptr)
- return 1;
-
// remove event from the notify menu
int iMenuId = e->menuId;
if (iMenuId > 0) {
@@ -334,14 +322,17 @@ int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
mii.fMask = MIIM_DATA;
if (GetMenuItemInfo(cfg::dat.hMenuNotify, iMenuId, FALSE, &mii) != 0) {
struct NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
- if (nmi && nmi->hContact == hContact && nmi->hDbEvent == hDbEvent) {
+ if (nmi && nmi->hContact == e->hContact && nmi->hDbEvent == e->hDbEvent) {
free(nmi);
DeleteMenu(cfg::dat.hMenuNotify, iMenuId, MF_BYCOMMAND);
}
}
}
- int res = coreCli.pfnRemoveEvent(hContact, hDbEvent);
+ // save variables, because core call frees the structure
+ auto hContact = e->hContact;
+ auto hDbEvent = e->hDbEvent;
+ int res = coreCli.pfnFreeEvent(e);
if (g_clistApi.events->getCount() == 0) {
cfg::dat.bEventAreaEnabled = FALSE;
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp
index a46350cb87..e9cf0b9f50 100644
--- a/plugins/Clist_nicer/src/init.cpp
+++ b/plugins/Clist_nicer/src/init.cpp
@@ -52,7 +52,7 @@ ClcGroup* AddGroup(HWND hwnd, struct ClcData *dat, const wchar_t *szName, uint
ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hContact);
ClcContact* AddInfoItemToGroup(ClcGroup *group, int flags, const wchar_t *pszText);
LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
-int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent);
+int RemoveEvent(CListEvent *);
INT_PTR TrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
void RecalcScrollBar(HWND hwnd, struct ClcData *dat);
@@ -196,7 +196,7 @@ int CMPlugin::Load()
g_clistApi.pfnAddContactToGroup = AddContactToGroup;
g_clistApi.pfnAddEvent = AddEvent;
- g_clistApi.pfnRemoveEvent = RemoveEvent;
+ g_clistApi.pfnFreeEvent = RemoveEvent;
g_clistApi.pfnAddGroup = AddGroup;
g_clistApi.pfnAddInfoItemToGroup = AddInfoItemToGroup;
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp
index 5336ec84ee..a60d970173 100644
--- a/plugins/FileAsMessage/src/dialog.cpp
+++ b/plugins/FileAsMessage/src/dialog.cpp
@@ -67,7 +67,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
case WM_COMMAND:
{
PUDeletePopup(hWnd);
- g_clistApi.pfnRemoveEvent(hContact, 0);
+ Clist_RemoveEvent(hContact, 0);
if (IsWindow(hDlg)) {
ShowWindow(hDlg, SW_SHOWNORMAL);
@@ -488,7 +488,7 @@ void FILEECHO::onRecvTimer()
setState(STATE_FINISHED);
if (db_get_b(0, "SRFile", "AutoClose", 0)) {
PostMessage(hDlg, WM_CLOSE, 0, 0);
- g_clistApi.pfnRemoveEvent(hContact, 0);
+ Clist_RemoveEvent(hContact, 0);
}
Skin_PlaySound("FileDone");
destroyTransfer();
diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas
index ce87e08aef..b67e82c1f6 100644
--- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas
+++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas
@@ -533,7 +533,7 @@ begin
begin
if (not Item.IsRead) then
db_event_markRead(Items[Index].hContact, Items[Index].hDBEvent);
- cli^.pfnRemoveEvent(Items[Index].hContact, Items[Index].hDBEvent);
+ Clist_RemoveEvent(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 a314bbdce4..4908bd5340 100644
--- a/plugins/IEView/src/HTMLBuilder.cpp
+++ b/plugins/IEView/src/HTMLBuilder.cpp
@@ -206,7 +206,7 @@ void HTMLBuilder::appendEventOld(IEView *view, IEVIEWEVENT *event)
if (!(dbei.flags & DBEF_SENT) && dbei.eventType == EVENTTYPE_MESSAGE) {
db_event_markRead(event->hContact, hDbEvent);
- g_clistApi.pfnRemoveEvent(event->hContact, hDbEvent);
+ Clist_RemoveEvent(event->hContact, hDbEvent);
}
if (!isDbEventShown(dbei)) {
diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp
index 61135eac38..446bccb3bc 100644
--- a/plugins/MirandaG15/src/CAppletManager.cpp
+++ b/plugins/MirandaG15/src/CAppletManager.cpp
@@ -783,7 +783,7 @@ bool CAppletManager::IsMessageWindowOpen(MCONTACT hContact)
void CAppletManager::MarkMessageAsRead(MCONTACT hContact, MEVENT hEvent)
{
db_event_markRead(hContact, hEvent);
- g_clistApi.pfnRemoveEvent(hContact, hEvent);
+ Clist_RemoveEvent(hContact, hEvent);
}
//************************************************************************
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index c0218bf43d..7dadd95c8e 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -82,7 +82,7 @@ int PopupAct(HWND hWnd, UINT mask, PLUGIN_DATA *pdata)
if (mask & MASK_REMOVE) {
if (pdata) {
for (auto &it: pdata->events) {
- g_clistApi.pfnRemoveEvent(pdata->hContact, it);
+ Clist_RemoveEvent(pdata->hContact, it);
db_event_markRead(pdata->hContact, it);
}
}
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp
index 9cb03ac103..51139dd075 100644
--- a/plugins/NewStory/src/history_array.cpp
+++ b/plugins/NewStory/src/history_array.cpp
@@ -115,7 +115,7 @@ void ItemData::load(bool bFullLoad)
if (!(dbe.flags & DBEF_SENT)) {
if (!dbe.markedRead())
db_event_markRead(hContact, hEvent);
- g_clistApi.pfnRemoveEvent(hContact, hEvent);
+ Clist_RemoveEvent(hContact, hEvent);
}
__fallthrough;
diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp
index 125aa07d58..895ae9af79 100644
--- a/plugins/NotesAndReminders/src/reminders.cpp
+++ b/plugins/NotesAndReminders/src/reminders.cpp
@@ -118,7 +118,7 @@ static void RemoveReminderSystemEvent(REMINDERDATA *p)
break;
if ((ULONG)pev->lParam == p->uid && !pev->hContact && pev->pszService && !mir_strcmp(pev->pszService, MODULENAME"/OpenTriggeredReminder")) {
- if (!g_clistApi.pfnRemoveEvent(pev->hContact, pev->hDbEvent)) {
+ if (!Clist_RemoveEvent(pev->hContact, pev->hDbEvent)) {
p->bSystemEventQueued = false;
if (QueuedReminderCount)
QueuedReminderCount--;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index d6d589bd69..c35b779569 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -1042,7 +1042,7 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_si->wState &= ~GC_EVENT_HIGHLIGHT;
if (Clist_GetEvent(m_hContact, 0))
- g_clistApi.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(m_hContact, GC_FAKE_EVENT);
}
FixTabIcons();
@@ -1064,7 +1064,7 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0)
db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0);
if (Clist_GetEvent(m_hContact, 0))
- g_clistApi.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(m_hContact, GC_FAKE_EVENT);
}
else {
if (m_hDbUnreadEventFirst != 0) {
@@ -1073,7 +1073,7 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
while (hDbEvent != 0) {
DB::EventInfo dbei(hDbEvent, false);
if (!(dbei.flags & DBEF_SENT) && DbEventIsMessageOrCustom(dbei))
- g_clistApi.pfnRemoveEvent(m_hContact, hDbEvent);
+ Clist_RemoveEvent(m_hContact, hDbEvent);
hDbEvent = db_event_next(m_hContact, hDbEvent);
}
}
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 0bbd71f0c7..264551e372 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -183,7 +183,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam)
wchar_t szTip[256];
mir_snwprintf(szTip, TranslateT("%s is typing a message"), Clist_GetContactDisplayName(hContact));
if (g_dat.flags2.bShowTypingClist) {
- g_clistApi.pfnRemoveEvent(hContact, 1);
+ Clist_RemoveEvent(hContact, 1);
CLISTEVENT cle = {};
cle.hContact = hContact;
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp
index 8c3d507819..f6340ffcd3 100644
--- a/plugins/TabSRMM/src/chat_tools.cpp
+++ b/plugins/TabSRMM/src/chat_tools.cpp
@@ -41,7 +41,7 @@ static void __stdcall Chat_DismissPopup(void *pi)
SESSION_INFO *si = (SESSION_INFO*)pi;
if (si->hContact)
if (Clist_GetEvent(si->hContact, 0))
- g_clistApi.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(si->hContact, GC_FAKE_EVENT);
if (si->pDlg && si->pDlg->timerFlash.Stop())
FlashWindow(si->pDlg->GetHwnd(), FALSE);
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index 67685eabfa..1c649e6c4c 100644
--- a/plugins/TabSRMM/src/hotkeyhandler.cpp
+++ b/plugins/TabSRMM/src/hotkeyhandler.cpp
@@ -224,7 +224,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (cle) {
if (ServiceExists(cle->pszService)) {
CallService(cle->pszService, 0, (LPARAM)cle);
- g_clistApi.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ Clist_RemoveEvent(cle->hContact, cle->hDbEvent);
}
}
// still, we got that message posted.. the event may be waiting in tabSRMMs tray...
@@ -266,7 +266,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
- g_clistApi.pfnRemoveEvent(wParam, lParam);
+ Clist_RemoveEvent(wParam, lParam);
db_event_markRead(wParam, lParam);
return 0;
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 07ad8f5f68..78d7a798b2 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -291,7 +291,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM nSecs)
Clist_TrayNotifyW(nullptr, TranslateT("Typing notification"), szTip, NIIF_INFO, 1000 * 4);
if (fShowOnClist) {
- g_clistApi.pfnRemoveEvent(hContact, 1);
+ Clist_RemoveEvent(hContact, 1);
CLISTEVENT cle = {};
cle.hContact = hContact;
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 7d6316ac5f..253aa0c7b6 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -696,7 +696,7 @@ void CMsgDialog::OnDestroy()
if (m_si) {
if (Clist_GetEvent(m_si->hContact, 0))
- g_clistApi.pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(m_si->hContact, GC_FAKE_EVENT);
m_si->wState &= ~STATE_TALK;
m_si->pDlg = nullptr;
m_si = nullptr;
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp
index 5a736cd187..cabaad93fc 100644
--- a/plugins/TabSRMM/src/msgdlgother.cpp
+++ b/plugins/TabSRMM/src/msgdlgother.cpp
@@ -2954,7 +2954,7 @@ void CMsgDialog::UpdateWindowState(UINT msg)
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 (Clist_GetEvent(m_si->hContact, 0))
- g_clistApi.pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(m_si->hContact, GC_FAKE_EVENT);
UpdateTitle();
m_hTabIcon = m_hTabStatusIcon;
@@ -2983,7 +2983,7 @@ void CMsgDialog::UpdateWindowState(UINT msg)
if (m_bFlashClist) {
m_bFlashClist = false;
if (m_hFlashingEvent != 0)
- g_clistApi.pfnRemoveEvent(m_hContact, m_hFlashingEvent);
+ Clist_RemoveEvent(m_hContact, m_hFlashingEvent);
m_hFlashingEvent = 0;
}
m_pContainer->cfg.flags.m_bNeedsUpdateTitle = false;
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 49743a5544..84967831e1 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -567,7 +567,7 @@ bool CLogWindow::CreateRtfEvent(RtfLogStreamData *streamData, DB::EventInfo &dbe
BOOL bIsStatusChangeEvent = IsStatusEvent(dbei.eventType);
if (!isSent && (bIsStatusChangeEvent || dbei.eventType == EVENTTYPE_MESSAGE || dbei.isSrmm())) {
db_event_markRead(streamData->hContact, streamData->hDbEvent);
- g_clistApi.pfnRemoveEvent(streamData->hContact, streamData->hDbEvent);
+ Clist_RemoveEvent(streamData->hContact, streamData->hDbEvent);
}
CMStringW msg(ptrW(DbEvent_GetTextW(&dbei, CP_UTF8)));
diff --git a/plugins/VoiceService/src/VoiceCall.cpp b/plugins/VoiceService/src/VoiceCall.cpp
index 0f3e88089f..60768f924c 100644
--- a/plugins/VoiceService/src/VoiceCall.cpp
+++ b/plugins/VoiceService/src/VoiceCall.cpp
@@ -193,7 +193,7 @@ void VoiceCall::CreateDisplayName()
void VoiceCall::RemoveNotifications()
{
if (clistBlinking) {
- g_clistApi.pfnRemoveEvent(hContact, MEVENT(1001));
+ Clist_RemoveEvent(hContact, MEVENT(1001));
clistBlinking = false;
}
diff --git a/protocols/GmailNotifier/src/notify.cpp b/protocols/GmailNotifier/src/notify.cpp
index 73f744d421..99b26b8f55 100644
--- a/protocols/GmailNotifier/src/notify.cpp
+++ b/protocols/GmailNotifier/src/notify.cpp
@@ -73,7 +73,7 @@ int OpenBrowser(WPARAM hContact, LPARAM)
if (proto && !mir_strcmp(proto, MODULENAME)) {
Account *curAcc = GetAccountByContact(hContact);
PUDeletePopup(curAcc->popUpHwnd);
- g_clistApi.pfnRemoveEvent(curAcc->hContact, 1);
+ Clist_RemoveEvent(curAcc->hContact, 1);
if (GetKeyState(VK_SHIFT) >> 8 || optionWindowIsOpen)
return FALSE;
@@ -114,7 +114,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
case WM_CONTEXTMENU:
PUDeletePopup(hWnd);
curAcc->popUpHwnd = nullptr;
- g_clistApi.pfnRemoveEvent(hContact, 1);
+ Clist_RemoveEvent(hContact, 1);
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
@@ -128,7 +128,7 @@ void NotifyUser(Account *curAcc)
switch (curAcc->results_num) {
case 0:
PUDeletePopup(curAcc->popUpHwnd);
- g_clistApi.pfnRemoveEvent(curAcc->hContact, 1);
+ Clist_RemoveEvent(curAcc->hContact, 1);
if (curAcc->oldResults_num != 0)
g_plugin.setWord(curAcc->hContact, "Status", ID_STATUS_NONEW);
break;
@@ -156,7 +156,7 @@ void NotifyUser(Account *curAcc)
}
}
if (g_plugin.bNotifierOnTray && newMails > 0) {
- g_clistApi.pfnRemoveEvent(curAcc->hContact, 1);
+ Clist_RemoveEvent(curAcc->hContact, 1);
CLISTEVENT cle = {};
cle.hContact = curAcc->hContact;
diff --git a/protocols/ICQ-WIM/src/poll.cpp b/protocols/ICQ-WIM/src/poll.cpp
index ec98ea9443..64cac1e12c 100644
--- a/protocols/ICQ-WIM/src/poll.cpp
+++ b/protocols/ICQ-WIM/src/poll.cpp
@@ -307,7 +307,7 @@ void CIcqProto::ProcessNotification(const JSONNode &ev)
// we've read/removed some messages from server
if (iOldCount > m_unreadEmails) {
- g_clistApi.pfnRemoveEvent(0, ICQ_FAKE_EVENT_ID);
+ Clist_RemoveEvent(0, ICQ_FAKE_EVENT_ID);
return;
}
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp
index e8bdb1a5b3..f367bf727b 100644
--- a/protocols/IRCG/src/clist.cpp
+++ b/protocols/IRCG/src/clist.cpp
@@ -74,7 +74,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMStringW& name, const CMStringW& hostmas
cle.lParam = (LPARAM)pdci;
if (Clist_GetEvent(hContact, 0))
- g_clistApi.pfnRemoveEvent(hContact, -100);
+ Clist_RemoveEvent(hContact, -100);
g_clistApi.pfnAddEvent(&cle);
}
return TRUE;
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 983683ec43..75a7ffa3b8 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -562,7 +562,7 @@ int CJabberProto::AdhocForwardHandler(const TiXmlElement*, CJabberIqInfo *pInfo,
db_event_markRead(hContact, hDbEvent, true);
if (bRemoveCListEvents)
- g_clistApi.pfnRemoveEvent(hContact, hDbEvent);
+ Clist_RemoveEvent(hContact, hDbEvent);
}
}
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index bd918b7b93..7e2d06bf90 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -818,9 +818,9 @@ void CVkProto::MarkDialogAsRead(MCONTACT hContact)
DBEVENTINFO dbei = {};
if (!db_event_get(hDBEvent, &dbei) && !mir_strcmp(m_szModuleName, dbei.szModule)) {
db_event_markRead(hContact, hDBEvent, true);
- g_clistApi.pfnRemoveEvent(hMContact, hDBEvent);
+ Clist_RemoveEvent(hMContact, hDBEvent);
if (hContact != hMContact)
- g_clistApi.pfnRemoveEvent(hContact, hDBEvent);
+ Clist_RemoveEvent(hContact, hDBEvent);
}
hDBEvent = db_event_next(hContact, hDBEvent);
diff --git a/protocols/YAMN/src/browser/mailbrowser.cpp b/protocols/YAMN/src/browser/mailbrowser.cpp
index 7b1b68e35a..ab0f5bd068 100644
--- a/protocols/YAMN/src/browser/mailbrowser.cpp
+++ b/protocols/YAMN/src/browser/mailbrowser.cpp
@@ -652,7 +652,7 @@ void DoMailActions(HWND hDlg, CAccount *ActualAccount, struct CMailNumbers *MN,
// and remove the event
if ((nflags & YAMN_ACC_CONT) && (!(nflags & YAMN_ACC_CONTNOEVENT)) && (MN->Real.UnSeen + MN->Virtual.UnSeen == 0))
- g_clistApi.pfnRemoveEvent(ActualAccount->hContact, ActualAccount->hContact);
+ Clist_RemoveEvent(ActualAccount->hContact, ActualAccount->hContact);
if ((MN->Real.BrowserUC + MN->Virtual.BrowserUC == 0) && (hDlg != nullptr)) {
if (!IsWindowVisible(hDlg) && !(nflags & YAMN_ACC_MSG))
@@ -796,7 +796,7 @@ LRESULT CALLBACK NewMailPopupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
}
}
if ((Account->NewMailN.Flags & YAMN_ACC_CONT) && !(Account->NewMailN.Flags & YAMN_ACC_CONTNOEVENT))
- g_clistApi.pfnRemoveEvent(hContact, hContact);
+ Clist_RemoveEvent(hContact, hContact);
}
__fallthrough;
@@ -1606,7 +1606,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
SetTimer(hDlg, TIMER_FLASHING, 500, nullptr);
if (ActualAccount->hContact != NULL)
- g_clistApi.pfnRemoveEvent(ActualAccount->hContact, (LPARAM)"yamn new mail message");
+ Clist_RemoveEvent(ActualAccount->hContact, (LPARAM)"yamn new mail message");
mir_subclassWindow(GetDlgItem(hDlg, IDC_LISTMAILS), ListViewSubclassProc);
}
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index 20e9ba44a9..c25d04eed1 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -268,7 +268,7 @@ static int SRFileProtoAck(WPARAM, LPARAM lParam)
int iEvent = 0;
while (auto *cle = Clist_GetEvent(ack->hContact, iEvent++))
if (cle->lParam == (LPARAM)ack->hProcess)
- g_clistApi.pfnRemoveEvent(ack->hContact, cle->hDbEvent);
+ Clist_RemoveEvent(ack->hContact, cle->hDbEvent);
}
return 0;
}
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 63fde09620..a13c704257 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -273,7 +273,7 @@ void CMsgDialog::OnActivate()
if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0)
db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0);
if (Clist_GetEvent(m_hContact, 0))
- g_clistApi.pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(m_hContact, GC_FAKE_EVENT);
}
else {
SetupStatusBar();
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 88cf6f656a..eab4269b80 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -195,7 +195,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam)
mir_snwprintf(szTip, TranslateT("%s is typing a message"), Clist_GetContactDisplayName(hContact));
if (g_plugin.bShowTypingClist) {
- g_clistApi.pfnRemoveEvent(hContact, 1);
+ Clist_RemoveEvent(hContact, 1);
CLISTEVENT cle = {};
cle.hContact = hContact;
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp
index e6a5d34e93..668050a8a2 100644
--- a/src/core/stdmsg/src/tabs.cpp
+++ b/src/core/stdmsg/src/tabs.cpp
@@ -477,7 +477,7 @@ void CTabbedWindow::TabClicked()
si->wState &= ~GC_EVENT_HIGHLIGHT;
if (Clist_GetEvent(si->hContact, 0))
- g_clistApi.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(si->hContact, GC_FAKE_EVENT);
}
if (!si->pDlg) {
diff --git a/src/core/stduseronline/src/useronline.cpp b/src/core/stduseronline/src/useronline.cpp
index be50bf3165..b9e4b15878 100644
--- a/src/core/stduseronline/src/useronline.cpp
+++ b/src/core/stduseronline/src/useronline.cpp
@@ -41,7 +41,7 @@ static int UserOnlineSettingChanged(WPARAM hContact, LPARAM lParam)
// Remove the event from the queue if it exists since they are now offline
MEVENT lastEvent = g_plugin.getDword(hContact, "LastEvent");
if (lastEvent) {
- g_clistApi.pfnRemoveEvent(hContact, lastEvent);
+ Clist_RemoveEvent(hContact, lastEvent);
g_plugin.setDword(hContact, "LastEvent", 0);
}
}
diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp
index 425f80753e..91895d3046 100644
--- a/src/mir_app/src/chat_log.cpp
+++ b/src/mir_app/src/chat_log.cpp
@@ -321,7 +321,7 @@ void CRtfLogWindow::CreateChatRtfMessage(RtfChatLogStreamData *streamData, const
if (!dbei.markedRead()) {
if (dbei.eventType == EVENTTYPE_MESSAGE || dbei.eventType == EVENTTYPE_FILE || dbei.isSrmm()) {
db_event_markRead(si->hContact, lin.hEvent);
- g_clistApi.pfnRemoveEvent(si->hContact, lin.hEvent);
+ Clist_RemoveEvent(si->hContact, lin.hEvent);
}
}
diff --git a/src/mir_app/src/chat_manager.cpp b/src/mir_app/src/chat_manager.cpp
index 394f0d16e7..b0c4999d89 100644
--- a/src/mir_app/src/chat_manager.cpp
+++ b/src/mir_app/src/chat_manager.cpp
@@ -114,7 +114,7 @@ static SESSION_INFO* SM_CreateSession(void)
void SM_FreeSession(SESSION_INFO *si)
{
if (Clist_GetEvent(si->hContact, 0))
- g_clistApi.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(si->hContact, GC_FAKE_EVENT);
si->wState &= ~STATE_TALK;
db_set_w(si->hContact, si->pszModule, "ApparentMode", 0);
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp
index fc6e001881..e03d826320 100644
--- a/src/mir_app/src/chat_svc.cpp
+++ b/src/mir_app/src/chat_svc.cpp
@@ -823,7 +823,7 @@ static int OnEventAdded(WPARAM hContact, LPARAM hDbEvent)
Chat_EventToGC(si, hDbEvent);
}
else {
- g_clistApi.pfnRemoveEvent(hContact, 1);
+ Clist_RemoveEvent(hContact, 1);
DB::EventInfo dbei(hDbEvent, false);
if (dbei) {
diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp
index cbe06d3d77..e2b4865e12 100644
--- a/src/mir_app/src/chat_tools.cpp
+++ b/src/mir_app/src/chat_tools.cpp
@@ -137,7 +137,7 @@ static void AddEvent(MCONTACT hContact, HICON hIcon, int type, const wchar_t *pw
}
else {
if (Clist_GetEvent(hContact, 0))
- g_clistApi.pfnRemoveEvent(hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(hContact, GC_FAKE_EVENT);
g_clistApi.pfnAddEvent(&cle);
}
}
@@ -229,7 +229,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
SESSION_INFO *si = (SESSION_INFO*)PUGetPluginData(hWnd);
if (si->hContact)
if (Clist_GetEvent(si->hContact, 0))
- g_clistApi.pfnRemoveEvent(si->hContact, GC_FAKE_EVENT);
+ Clist_RemoveEvent(si->hContact, GC_FAKE_EVENT);
if (si->pDlg && si->pDlg->timerFlash.Stop())
FlashWindow(si->pDlg->GetHwnd(), FALSE);
diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h
index 6a38b78e9f..39425f98a6 100644
--- a/src/mir_app/src/clc.h
+++ b/src/mir_app/src/clc.h
@@ -121,7 +121,7 @@ void UnregisterFileDropping(HWND hwnd);
struct CListEvent* fnAddEvent(CLISTEVENT *cle);
int fnGetImlIconIndex(HICON hIcon);
-int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent);
+int fnRemoveEvent(CListEvent *pEvent);
int EventsProcessContactDoubleClick(MCONTACT hContact);
diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp
index dcb1b64045..dfcc6e81e4 100644
--- a/src/mir_app/src/clistcore.cpp
+++ b/src/mir_app/src/clistcore.cpp
@@ -101,7 +101,7 @@ void InitClistCore()
g_clistApi.pfnAddEvent = fnAddEvent;
g_clistApi.pfnGetImlIconIndex = fnGetImlIconIndex;
- g_clistApi.pfnRemoveEvent = fnRemoveEvent;
+ g_clistApi.pfnFreeEvent = fnRemoveEvent;
g_clistApi.pfnInvalidateDisplayNameCacheEntry = fnInvalidateDisplayNameCacheEntry;
g_clistApi.pfnCreateCacheItem = fnCreateCacheItem;
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp
index 51185c681f..1bf064b467 100644
--- a/src/mir_app/src/clistevents.cpp
+++ b/src/mir_app/src/clistevents.cpp
@@ -146,7 +146,7 @@ static VOID CALLBACK IconFlashTimer(HWND, UINT, UINT_PTR idEvent, DWORD)
// decrease eflashes in any case - no need to collect all events
if (e.flags & CLEF_ONLYAFEW)
if (0 >= --e.flashesDone)
- g_clistApi.pfnRemoveEvent(e.hContact, e.hDbEvent);
+ Clist_RemoveEvent(e.hContact, e.hDbEvent);
}
if (g_cliEvents.getCount() == 0) {
@@ -194,24 +194,14 @@ CListEvent* fnAddEvent(CLISTEVENT *cle)
// Removes an event from the contact list's queue
// Returns 0 if the event was successfully removed, or nonzero if the event was not found
-int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent)
+int fnRemoveEvent(CListEvent *pEvent)
{
- // Find the event that should be removed
- CListEvent *pEvent = nullptr;
- for (auto &it : g_cliEvents) {
- if (it->hContact == hContact && it->hDbEvent == dbEvent) {
- pEvent = it;
- break;
- }
- }
-
- // Event was not found
- if (pEvent == nullptr)
- return 1;
+ // save hContact, because pEvent should be freed
+ auto hContact = pEvent->hContact;
// Update contact's icon
char *szProto = Proto_GetBaseAccountName(hContact);
- Clist_ChangeContactIcon(pEvent->hContact, Clist_GetContactIcon(pEvent->hContact));
+ Clist_ChangeContactIcon(hContact, Clist_GetContactIcon(hContact));
// Free any memory allocated to the event
g_cliEvents.remove(pEvent);
@@ -242,6 +232,30 @@ int fnRemoveEvent(MCONTACT hContact, MEVENT dbEvent)
/////////////////////////////////////////////////////////////////////////////////////////
+MIR_APP_DLL(CListEvent *) Clist_FindEvent(MCONTACT hContact, MEVENT hDbEvent)
+{
+ for (auto &it : g_cliEvents) {
+ if ((hContact == it->hContact || hContact == -1) && it->hDbEvent == hDbEvent)
+ return it;
+ }
+
+ return nullptr;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_APP_DLL(int) Clist_RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
+{
+ if (auto *pEvent = Clist_FindEvent(hContact, hDbEvent)) {
+ g_clistApi.pfnFreeEvent(pEvent);
+ return 0;
+ }
+
+ return 1;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
MIR_APP_DLL(CListEvent *) Clist_GetEvent(MCONTACT hContact, int idx)
{
if (hContact == INVALID_CONTACT_ID) {
@@ -264,9 +278,8 @@ int EventsProcessContactDoubleClick(MCONTACT hContact)
{
for (auto &it : g_cliEvents) {
if (it->hContact == hContact) {
- MEVENT hDbEvent = it->hDbEvent;
CallService(it->pszService, 0, (LPARAM)it);
- g_clistApi.pfnRemoveEvent(hContact, hDbEvent);
+ g_clistApi.pfnFreeEvent(it);
return 0;
}
}
@@ -338,7 +351,7 @@ MIR_APP_DLL(int) Clist_EventsProcessTrayDoubleClick(int index)
MCONTACT hContact = pEvent->hContact;
MEVENT hDbEvent = pEvent->hDbEvent;
CallService(pEvent->pszService, 0, (LPARAM)pEvent);
- g_clistApi.pfnRemoveEvent(hContact, hDbEvent);
+ Clist_RemoveEvent(hContact, hDbEvent);
return 0;
}
@@ -347,7 +360,7 @@ MIR_APP_DLL(int) Clist_EventsProcessTrayDoubleClick(int index)
static int CListEventMarkedRead(WPARAM hContact, LPARAM hDbEvent)
{
- g_clistApi.pfnRemoveEvent(hContact, hDbEvent);
+ Clist_RemoveEvent(hContact, hDbEvent);
return 0;
}
diff --git a/src/mir_app/src/clistsettings.cpp b/src/mir_app/src/clistsettings.cpp
index 4d3e60b9d4..b19de6d6a9 100644
--- a/src/mir_app/src/clistsettings.cpp
+++ b/src/mir_app/src/clistsettings.cpp
@@ -161,7 +161,7 @@ int ContactDeleted(WPARAM hContact, LPARAM)
// remove events for a contact
for (auto &it : g_cliEvents.rev_iter())
if (it->hContact == hContact)
- g_clistApi.pfnRemoveEvent(hContact, it->hDbEvent);
+ Clist_RemoveEvent(hContact, it->hDbEvent);
Chat_RemoveContact(hContact);
return 0;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 4dba25cc4d..02620ec096 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -870,3 +870,5 @@ Chat_IsMuted @941 NONAME
?setSize@FILE_BLOB@DB@@QAEX_J@Z @985 NONAME
?setUrl@FILE_BLOB@DB@@QAEXPBD@Z @986 NONAME
?Clist_GetEvent@@YGPAUCListEvent@@IH@Z @987 NONAME
+?Clist_FindEvent@@YGPAUCListEvent@@II@Z @988 NONAME
+Clist_RemoveEvent @989
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 6c56bbbffa..f6b294699f 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -870,3 +870,5 @@ Chat_IsMuted @941 NONAME
?setSize@FILE_BLOB@DB@@QEAAX_J@Z @985 NONAME
?setUrl@FILE_BLOB@DB@@QEAAXPEBD@Z @986 NONAME
?Clist_GetEvent@@YAPEAUCListEvent@@IH@Z @987 NONAME
+?Clist_FindEvent@@YAPEAUCListEvent@@II@Z @988 NONAME
+Clist_RemoveEvent @989
diff --git a/src/mir_app/src/srmm_log_rtf.cpp b/src/mir_app/src/srmm_log_rtf.cpp
index ccd1480ba3..7c40253003 100644
--- a/src/mir_app/src/srmm_log_rtf.cpp
+++ b/src/mir_app/src/srmm_log_rtf.cpp
@@ -296,7 +296,7 @@ static bool CreateRtfFromDbEvent(RtfLogStreamData *dat)
if (!(dbei.flags & DBEF_SENT) && (dbei.eventType == EVENTTYPE_MESSAGE || dbei.isSrmm())) {
db_event_markRead(dat->hContact, dat->hDbEvent);
- g_clistApi.pfnRemoveEvent(dat->hContact, dat->hDbEvent);
+ Clist_RemoveEvent(dat->hContact, dat->hDbEvent);
}
else if (dbei.eventType == EVENTTYPE_JABBER_CHATSTATES || dbei.eventType == EVENTTYPE_JABBER_PRESENCE) {
db_event_markRead(dat->hContact, dat->hDbEvent);