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 | |
parent | 4d29366657d2ee93db4913a5a07af0d26820c058 (diff) |
PROTO_INTERFACE::OnContactDeleted to be able to block the contact's deletion
Diffstat (limited to 'protocols/Discord')
-rw-r--r-- | protocols/Discord/src/proto.cpp | 5 | ||||
-rw-r--r-- | protocols/Discord/src/proto.h | 2 |
2 files changed, 4 insertions, 3 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;
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h index 6e62cb0d5a..d6aa55c990 100644 --- a/protocols/Discord/src/proto.h +++ b/protocols/Discord/src/proto.h @@ -377,7 +377,7 @@ public: int SetStatus(int iNewStatus) override;
void OnBuildProtoMenu() override;
- void OnContactDeleted(MCONTACT) override;
+ bool OnContactDeleted(MCONTACT) override;
MWindow OnCreateAccMgrUI(MWindow) override;
void OnMarkRead(MCONTACT, MEVENT) override;
void OnModulesLoaded() override;
|