summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-27 18:53:07 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-27 18:53:07 +0300
commitc5c5972135f392bd2ab5bacc6ce476e3aa267ca3 (patch)
tree7e286ac886d733e5a9273fa96f71d9ecd7436b0a /src
parent33abe40382ca512cca7a21da2abfa685ce98d65c (diff)
Clist events:
- no need to save 4 bytes each time we wanna declare protocol-wide events; - all event adding code is forced to be executed in the main thread; - also fixes #1904 (ICQ: mail notification bug); - now we can use any event ids for global events.
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/clistevents.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mir_app/src/clistevents.cpp b/src/mir_app/src/clistevents.cpp
index ecb1672986..d3163cd4dc 100644
--- a/src/mir_app/src/clistevents.cpp
+++ b/src/mir_app/src/clistevents.cpp
@@ -71,7 +71,7 @@ static const char* GetEventProtocol(const CListEvent &ev)
if (ev.hContact != 0)
return GetContactProto(ev.hContact);
- return (ev.flags & CLEF_PROTOCOLGLOBAL) ? ev.lpszProtocol : nullptr;
+ return (ev.flags & CLEF_PROTOCOLGLOBAL) ? ev.moduleName : nullptr;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -154,10 +154,9 @@ static VOID CALLBACK IconFlashTimer(HWND, UINT, UINT_PTR idEvent, DWORD)
iconsOn = !iconsOn;
}
-CListEvent* fnAddEvent(CLISTEVENT *cle)
+static INT_PTR CALLBACK DoAddEvent(void *param)
{
- if (cle == nullptr)
- return nullptr;
+ CLISTEVENT *cle = (CLISTEVENT*)param;
CListEvent *p = new CListEvent();
memcpy(p, cle, sizeof(*cle));
@@ -177,7 +176,15 @@ CListEvent* fnAddEvent(CLISTEVENT *cle)
TrayIconUpdateWithImageList(p->imlIconIndex, p->szTooltip.w, GetEventProtocol(*p));
}
Clist_ChangeContactIcon(cle->hContact, p->imlIconIndex);
- return p;
+ return (INT_PTR)p;
+}
+
+CListEvent* fnAddEvent(CLISTEVENT *cle)
+{
+ if (cle == nullptr)
+ return nullptr;
+
+ return (CListEvent*)CallFunctionSync(DoAddEvent, cle);
}
// Removes an event from the contact list's queue