diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-02 18:06:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-02 18:06:21 +0300 |
commit | 79bb3a95b667c34c046f00672467bc4604269d1b (patch) | |
tree | 6ead18282f4e7380eea14ff76085a8f651211769 | |
parent | bb99780c2c6d6798605a5820b5312f5e765317e3 (diff) |
fixes #2190 (KeyboardNotify: blinking in group chats doesn't work)
-rw-r--r-- | plugins/KeyboardNotify/src/main.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index d5c9e650ca..02621dac3e 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -407,10 +407,13 @@ static int PluginMessageEventHook(WPARAM hContact, LPARAM hEvent) // monitors group chat events
static int OnGcEvent(WPARAM, LPARAM lParam)
{
- GCHOOK *gc = (GCHOOK *)lParam;
- if (gc->iType == GC_USER_MESSAGE && bFlashOnGC)
- if (contactCheckProtocol(gc->si->pszModule, gc->si->hContact, EVENTTYPE_MESSAGE) && checkNotifyOptions() && checkStatus(gc->si->pszModule))
- SetEvent(hFlashEvent);
+ auto *gce = (GCEVENT *)lParam;
+ if (gce->iType == GC_EVENT_MESSAGE && bFlashOnGC) {
+ SESSION_INFO *si = g_chatApi.SM_FindSession(gce->pszID.w, gce->pszModule);
+ if (si)
+ if (contactCheckProtocol(si->pszModule, si->hContact, EVENTTYPE_MESSAGE) && checkNotifyOptions() && checkStatus(si->pszModule))
+ SetEvent(hFlashEvent);
+ }
return 0;
}
@@ -913,7 +916,7 @@ int CMPlugin::Load() OpenKeyboardDevice();
HookEvent(ME_MC_ENABLED, OnMetaChanged);
- HookEvent(ME_GC_EVENT, OnGcEvent);
+ HookEvent(ME_GC_HOOK_EVENT, OnGcEvent);
HookEvent(ME_DB_EVENT_ADDED, PluginMessageEventHook);
HookEvent(ME_OPT_INITIALISE, InitializeOptions);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
|