diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-09 20:00:47 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-09 20:00:47 +0300 |
commit | dbc48cc0ec4df774c257d5175d62bce16e2437e3 (patch) | |
tree | 525937d7b3e549bb75a817571dcecc0f7e32f82d /protocols/Discord/src/proto.cpp | |
parent | 4d29366657d2ee93db4913a5a07af0d26820c058 (diff) |
PROTO_INTERFACE::OnContactDeleted to be able to block the contact's deletion
Diffstat (limited to 'protocols/Discord/src/proto.cpp')
-rw-r--r-- | protocols/Discord/src/proto.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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;
}
/////////////////////////////////////////////////////////////////////////////////////////
|