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/Twitter/src/contacts.cpp | 5 +++-- protocols/Twitter/src/proto.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'protocols/Twitter') diff --git a/protocols/Twitter/src/contacts.cpp b/protocols/Twitter/src/contacts.cpp index 09c8768582..3e019866ec 100644 --- a/protocols/Twitter/src/contacts.cpp +++ b/protocols/Twitter/src/contacts.cpp @@ -154,10 +154,10 @@ HANDLE CTwitterProto::GetAwayMsg(MCONTACT hContact) return (HANDLE)1; } -void CTwitterProto::OnContactDeleted(MCONTACT hContact) +bool CTwitterProto::OnContactDeleted(MCONTACT hContact) { if (m_iStatus != ID_STATUS_ONLINE) - return; + return false; ptrA szId(getStringA(hContact, TWITTER_KEY_UN)); if (szId) { @@ -167,6 +167,7 @@ void CTwitterProto::OnContactDeleted(MCONTACT hContact) mir_cslock s(twitter_lock_); remove_friend(szId.get()); // Be careful about this until Miranda is fixed } + return true; } void CTwitterProto::OnMarkRead(MCONTACT hContact, MEVENT hDbEvent) diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h index d75753d0b2..e3e5650b4d 100644 --- a/protocols/Twitter/src/proto.h +++ b/protocols/Twitter/src/proto.h @@ -183,7 +183,7 @@ public: HANDLE GetAwayMsg(MCONTACT) override; - void OnContactDeleted(MCONTACT) override; + bool OnContactDeleted(MCONTACT) override; MWindow OnCreateAccMgrUI(MWindow) override; void OnMarkRead(MCONTACT, MEVENT) override; void OnModulesLoaded() override; -- cgit v1.2.3