diff options
-rw-r--r-- | include/m_protoint.h | 3 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 207164 -> 207490 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 202792 -> 203122 bytes | |||
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 5 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 5 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.h | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 1 | ||||
-rw-r--r-- | src/mir_app/src/proto_accs.cpp | 10 | ||||
-rw-r--r-- | src/mir_app/src/proto_interface.cpp | 3 |
10 files changed, 27 insertions, 2 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h index 9bc9def714..c4f58111a8 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -243,6 +243,9 @@ public: // called when an account's contact is deleted
virtual void OnContactDeleted(MCONTACT);
+ // called when an event is altered in database
+ virtual void OnEventEdited(MCONTACT, MEVENT);
+
// called when an account gets physically removed from the database
virtual void OnErase();
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 699ccd8e8f..89e16b8e60 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 0ee65cfdba..95053c8104 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index ef997f829a..3fe1f06589 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -153,9 +153,12 @@ struct NewstoryListData : public MZeroedObject if (pItem->hContact && pItem->hEvent) { ptrA szUtf(mir_utf8encodeW(pItem->wtext)); - pItem->dbe.cbBlob = mir_strlen(szUtf) + 1; + pItem->dbe.cbBlob = (int)mir_strlen(szUtf) + 1; pItem->dbe.pBlob = (BYTE *)szUtf.get(); db_event_edit(pItem->hContact, pItem->hEvent, &pItem->dbe); + + if (auto *ppro = Proto_GetInstance(pItem->hContact)) + ppro->OnEventEdited(pItem->hContact, pItem->hEvent); } MTextDestroy(pItem->data); pItem->data = 0; diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index 6fbac6f3ab..7a468d414c 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -152,6 +152,11 @@ void CIcqProto::OnContactDeleted(MCONTACT hContact) << AIMSID(this) << WCHAR_PARAM("buddy", szId) << INT_PARAM("allGroups", 1)); } +void CIcqProto::OnEventEdited(MCONTACT, MEVENT) +{ + +} + INT_PTR CIcqProto::OnMenuLoadHistory(WPARAM hContact, LPARAM) { delSetting(hContact, DB_KEY_LASTMSGID); diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h index f6c33a8fd0..eb0c5fe6a9 100644 --- a/protocols/ICQ-WIM/src/proto.h +++ b/protocols/ICQ-WIM/src/proto.h @@ -425,6 +425,7 @@ class CIcqProto : public PROTO<CIcqProto> void OnBuildProtoMenu(void) override; void OnContactDeleted(MCONTACT) override; + void OnEventEdited(MCONTACT, MEVENT) override; void OnModulesLoaded() override; void OnShutdown() override; 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() {} |