summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-23 19:05:51 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-23 19:05:51 +0300
commit60fec7a89a7870d52ebd76315193b105973b1219 (patch)
tree8df3b928516934d478367791bf5b8d2f4b92a930 /include
parent14b6b214743b1913258fc03c21f5e0841a66c2fd (diff)
fixes #4104 (Удаление серверной истории)
Diffstat (limited to 'include')
-rw-r--r--include/m_database.h8
-rw-r--r--include/m_protoint.h3
-rw-r--r--include/m_protosvc.h1
3 files changed, 10 insertions, 2 deletions
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