summaryrefslogtreecommitdiff
path: root/src/mir_core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-09 20:00:47 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-09 20:00:47 +0300
commitdbc48cc0ec4df774c257d5175d62bce16e2437e3 (patch)
tree525937d7b3e549bb75a817571dcecc0f7e32f82d /src/mir_core
parent4d29366657d2ee93db4913a5a07af0d26820c058 (diff)
PROTO_INTERFACE::OnContactDeleted to be able to block the contact's deletion
Diffstat (limited to 'src/mir_core')
-rw-r--r--src/mir_core/src/db.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp
index 0dec7c5ee6..4765a79ad4 100644
--- a/src/mir_core/src/db.cpp
+++ b/src/mir_core/src/db.cpp
@@ -111,7 +111,8 @@ MIR_CORE_DLL(int) db_delete_contact(MCONTACT hContact, bool bFromProto)
if (!bFromProto)
if (auto *ppro = Proto_GetInstance(hContact))
- ppro->OnContactDeleted(hContact);
+ if (!ppro->OnContactDeleted(hContact))
+ return 1;
Netlib_Logf(nullptr, "Contact deleted: %d", hContact);
return (g_pCurrDb) ? g_pCurrDb->DeleteContact(hContact) : 0;