diff options
author | George Hazan <ghazan@miranda.im> | 2023-03-17 17:37:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-03-17 17:37:02 +0300 |
commit | bd414857985d7f5dda6355bce340296ff0095ac1 (patch) | |
tree | 312b38daa8636a7e2ecbcf749bcc249591e06127 | |
parent | 83bc4b803968c60b358620948d148455bb4e3e75 (diff) |
SRMM marks messages as read, so let's call it as late as possible
-rw-r--r-- | src/mir_app/src/chat_svc.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index 9e6a89ea3f..d080a4b095 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -899,6 +899,13 @@ static int PrebuildContactMenu(WPARAM hContact, LPARAM) return 0;
}
+// function OnEventAdded() modifies an event, so let's call it after all handlers
+static int PostModulesLoaded(WPARAM, LPARAM)
+{
+ HookEvent(ME_DB_EVENT_ADDED, OnEventAdded);
+ return 0;
+}
+
static int ModulesLoaded(WPARAM, LPARAM)
{
SrmmModulesLoaded();
@@ -907,6 +914,7 @@ static int ModulesLoaded(WPARAM, LPARAM) HookEvent(ME_SMILEYADD_OPTIONSCHANGED, SmileyOptionsChanged);
HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
+ HookEvent(ME_SYSTEM_MODULESLOADED, PostModulesLoaded);
CMenuItem mi(&g_plugin);
SET_UID(mi, 0x2bb76d5, 0x740d, 0x4fd2, 0x8f, 0xee, 0x7c, 0xa4, 0x5a, 0x74, 0x65, 0xa6);
@@ -981,7 +989,6 @@ int LoadChatModule(void) {
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
- HookEvent(ME_DB_EVENT_ADDED, OnEventAdded);
HookEvent(ME_DB_CONTACT_DELETED, OnContactDeleted);
HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged);
HookEvent(ME_FONT_RELOAD, FontsChanged);
|