From 60fec7a89a7870d52ebd76315193b105973b1219 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 23 Jan 2024 19:05:51 +0300 Subject: =?UTF-8?q?fixes=20#4104=20(=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=D0=BD=D0=BE?= =?UTF-8?q?=D0=B9=20=D0=B8=D1=81=D1=82=D0=BE=D1=80=D0=B8=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/m_database.h | 8 +++++++- include/m_protoint.h | 3 ++- include/m_protosvc.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/m_database.h b/include/m_database.h index 55e24ff97e..3533980641 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -83,13 +83,19 @@ EXTERN_C MIR_CORE_DLL(int) db_delete_module(MCONTACT hContact, const char *szMod EXTERN_C MIR_CORE_DLL(MCONTACT) db_add_contact(void); // Deletes the contact hContact from the database and all events and settings associated with it. +// The 'flags' parameter could be zero of any combination of CDF_* constants // Returns 0 on success or nonzero if hContact was invalid // Please don't try to delete the user contact (hContact = NULL) // Triggers a db/contact/deleted event just *before* it removes anything // Because all events are deleted, lots of people may end up with invalid event // handles from this operation, which they should be prepared for. -EXTERN_C MIR_CORE_DLL(int) db_delete_contact(MCONTACT hContact, bool bFromProto = false); +#define CDF_FROM_SERVER 0x01 // delete operation requested from the server +#define CDF_DEL_CONTACT 0x02 // delete server contact +#define CDF_DEL_HISTORY 0x04 // delete server history (by default for me only) +#define CDF_FOR_EVERYONE 0x08 // delete server history for everyone, not just for you + +EXTERN_C MIR_CORE_DLL(int) db_delete_contact(MCONTACT hContact, uint32_t flags = 0); // Checks if a given value is a valid contact handle, note that due // to the nature of multiple threading, a valid contact can still become diff --git a/include/m_protoint.h b/include/m_protoint.h index 09f31ef992..a3df748937 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -259,8 +259,9 @@ public: virtual void OnContactAdded(MCONTACT); // called when an account's contact is deleted + // flags is a combination of CDF_* constants // returns true if deletion confirmed or false if not - virtual bool OnContactDeleted(MCONTACT); + virtual bool OnContactDeleted(MCONTACT, uint32_t flags); // called when the Account Manager needs to draw short account's options virtual MWindow OnCreateAccMgrUI(MWindow hwndParent); diff --git a/include/m_protosvc.h b/include/m_protosvc.h index 01eae97a2c..763534a509 100644 --- a/include/m_protosvc.h +++ b/include/m_protosvc.h @@ -127,6 +127,7 @@ static __inline unsigned long Proto_Status2Flag(int status) #define PFLAGNUM_4 4 #define PF4_FORCEAUTH 0x00000001 // forces auth requests to be sent when adding users +#define PF4_DELETEFORALL 0x00000002 // events could be removed for everyone in the chat #define PF4_NOCUSTOMAUTH 0x00000004 // protocol doesn't support custom auth text (doesn't show auth text box) #define PF4_SUPPORTTYPING 0x00000008 // protocol supports user is typing messages #define PF4_SUPPORTIDLE 0x00000010 // protocol understands idle -- cgit v1.2.3