From 4d6fa4f3f9fe692486a1e35cfe85a14ddac79d51 Mon Sep 17 00:00:00 2001 From: Mataes Date: Mon, 4 Nov 2019 22:52:17 +0300 Subject: newstory: added hook for ME_DB_EVENT_EDITED --- plugins/NewStory/src/history.cpp | 8 ++++++++ plugins/NewStory/src/history.h | 1 + plugins/NewStory/src/main.cpp | 5 +---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/NewStory/src/history.cpp b/plugins/NewStory/src/history.cpp index 6723d7f48c..79d0a7678a 100644 --- a/plugins/NewStory/src/history.cpp +++ b/plugins/NewStory/src/history.cpp @@ -29,12 +29,20 @@ int evtEventDeleted(WPARAM wParam, LPARAM lParam) return 0; } +int evtEventEdited(WPARAM wParam, LPARAM lParam) +{ + HWND hwnd = WindowList_Find(hNewstoryWindows, (UINT_PTR)wParam); + SendMessage(hwnd, UM_EDITEVENT, wParam, lParam); + return 0; +} + void InitHistory() { hNewstoryWindows = WindowList_Create(); HookEvent(ME_DB_EVENT_ADDED, evtEventAdded); HookEvent(ME_DB_EVENT_DELETED, evtEventDeleted); + HookEvent(ME_DB_EVENT_EDITED, evtEventEdited); } void FreeHistory() diff --git a/plugins/NewStory/src/history.h b/plugins/NewStory/src/history.h index cf89af421e..8d699bcbfe 100644 --- a/plugins/NewStory/src/history.h +++ b/plugins/NewStory/src/history.h @@ -16,6 +16,7 @@ enum UM_ADDEVENT, UM_ADDEVENTFILTER, UM_REMOVEEVENT, + UM_EDITEVENT, UM_SELECTED, diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp index 69a455ff93..59800536b0 100644 --- a/plugins/NewStory/src/main.cpp +++ b/plugins/NewStory/src/main.cpp @@ -11,8 +11,6 @@ #include "stdafx.h" -HANDLE hhkModulesLoaded = 0, hhkOptInitialise = 0, hhkTTBLoaded = 0; - CMPlugin g_plugin; ///////////////////////////////////////////////////////////////////////////////////////// @@ -104,13 +102,12 @@ int CMPlugin::Load() CreateServiceFunction(MS_HISTORY_SHOWCONTACTHISTORY, svcShowNewstory); CreateServiceFunction("Newstory/System", svcShowSystemNewstory); - hhkModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, evtModulesLoaded); + HookEvent(ME_SYSTEM_MODULESLOADED, evtModulesLoaded); return 0; } int CMPlugin::Unload() { - UnhookEvent(hhkModulesLoaded); FreeHistory(); return 0; } -- cgit v1.2.3