From dbc48cc0ec4df774c257d5175d62bce16e2437e3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 9 Dec 2023 20:00:47 +0300 Subject: PROTO_INTERFACE::OnContactDeleted to be able to block the contact's deletion --- protocols/Discord/src/proto.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'protocols/Discord/src/proto.cpp') diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index 423242c338..7e55ea5d65 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -625,17 +625,18 @@ int CDiscordProto::OnAccountChanged(WPARAM iAction, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// -void CDiscordProto::OnContactDeleted(MCONTACT hContact) +bool CDiscordProto::OnContactDeleted(MCONTACT hContact) { CDiscordUser *pUser = FindUser(getId(hContact, DB_KEY_ID)); if (pUser == nullptr || !m_bOnline) - return; + return false; if (pUser->channelId) Push(new AsyncHttpRequest(this, REQUEST_DELETE, CMStringA(FORMAT, "/channels/%lld", pUser->channelId), nullptr)); if (pUser->id) RemoveFriend(pUser->id); + return true; } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3