summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-06-15 11:05:09 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-06-15 11:05:09 +0300
commitda3b33dc68aeb3e8ff1eabdc478dd38625b7b2c1 (patch)
tree594548800fb2057c787c0fae3d79fc93496247c4 /src
parentd9b60b236e82599aa39ec76f063c1e20dd130678 (diff)
PROTO_INTERFACE::OnEventEdited - new virtual function to send edited messages to server
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/proto_accs.cpp10
-rw-r--r--src/mir_app/src/proto_interface.cpp3
4 files changed, 14 insertions, 1 deletions
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()
{}