From da3b33dc68aeb3e8ff1eabdc478dd38625b7b2c1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 15 Jun 2020 11:05:09 +0300 Subject: PROTO_INTERFACE::OnEventEdited - new virtual function to send edited messages to server --- src/mir_app/src/mir_app.def | 1 + src/mir_app/src/mir_app64.def | 1 + src/mir_app/src/proto_accs.cpp | 10 +++++++++- src/mir_app/src/proto_interface.cpp | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index bcd2992d42..c096e56e47 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -738,3 +738,4 @@ Chat_CreateMenu @824 NONAME ?PasteFilesAsURL@CSrmmBaseDialog@@IAE_NPAUHDROP__@@@Z @825 NONAME ?Proto_GetInstance@@YGPAUPROTO_INTERFACE@@I@Z @826 NONAME ?Proto_GetInstance@@YGPAUPROTO_INTERFACE@@PBD@Z @827 NONAME +?OnEventEdited@PROTO_INTERFACE@@UAEXII@Z @828 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index e7833f4d48..3cba4b2b3b 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -738,3 +738,4 @@ Chat_CreateMenu @824 NONAME ?PasteFilesAsURL@CSrmmBaseDialog@@IEAA_NPEAUHDROP__@@@Z @825 NONAME ?Proto_GetInstance@@YAPEAUPROTO_INTERFACE@@I@Z @826 NONAME ?Proto_GetInstance@@YAPEAUPROTO_INTERFACE@@PEBD@Z @827 NONAME +?OnEventEdited@PROTO_INTERFACE@@UEAAXII@Z @828 NONAME diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp index e3005c4cd7..5a19b43101 100644 --- a/src/mir_app/src/proto_accs.cpp +++ b/src/mir_app/src/proto_accs.cpp @@ -32,7 +32,7 @@ void BuildProtoMenus(); HICON Proto_GetIcon(PROTO_INTERFACE *ppro, int iconIndex); static bool bModuleInitialized = false; -static HANDLE hHooks[3]; +static HANDLE hHooks[4]; static int CompareAccounts(const PROTOACCOUNT* p1, const PROTOACCOUNT* p2) { @@ -157,6 +157,13 @@ static int OnContactDeleted(WPARAM hContact, LPARAM) return 0; } +static int OnEventEdited(WPARAM hContact, LPARAM hDbEvent) +{ + if (auto *ppro = Proto_GetInstance(hContact)) + ppro->OnEventEdited(hContact, hDbEvent); + return 0; +} + static int InitializeStaticAccounts(WPARAM, LPARAM) { int count = 0; @@ -221,6 +228,7 @@ int LoadAccountsModule(void) hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, InitializeStaticAccounts); hHooks[1] = HookEvent(ME_SYSTEM_PRESHUTDOWN, UninitializeStaticAccounts); hHooks[2] = HookEvent(ME_DB_CONTACT_DELETED, OnContactDeleted); + hHooks[3] = HookEvent(ME_DB_EVENT_EDITED, OnEventEdited); return 0; } diff --git a/src/mir_app/src/proto_interface.cpp b/src/mir_app/src/proto_interface.cpp index 8a917ad694..8eb3f862fc 100644 --- a/src/mir_app/src/proto_interface.cpp +++ b/src/mir_app/src/proto_interface.cpp @@ -58,6 +58,9 @@ void PROTO_INTERFACE::OnBuildProtoMenu() void PROTO_INTERFACE::OnContactDeleted(MCONTACT) {} +void PROTO_INTERFACE::OnEventEdited(MCONTACT, MEVENT) +{} + void PROTO_INTERFACE::OnErase() {} -- cgit v1.2.3