From f301df43fe8a0089ce581019804d4b3b25ca7ea9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 27 Dec 2018 23:24:13 +0300 Subject: Icq: support for user removing --- protocols/Icq10/src/proto.cpp | 55 +++++++++---------------------------------- protocols/Icq10/src/proto.h | 8 +------ 2 files changed, 12 insertions(+), 51 deletions(-) diff --git a/protocols/Icq10/src/proto.cpp b/protocols/Icq10/src/proto.cpp index 5f47b960e4..afff41cd90 100644 --- a/protocols/Icq10/src/proto.cpp +++ b/protocols/Icq10/src/proto.cpp @@ -80,6 +80,15 @@ void CIcqProto::OnShutdown() { } +void CIcqProto::OnContactDeleted(MCONTACT hContact) +{ + auto *pReq = new AsyncHttpRequest(CONN_MAIN, REQUEST_GET, ICQ_API_SERVER "/buddylist/removeBuddy"); + pReq << CHAR_PARAM("f", "json") << CHAR_PARAM("aimsid", m_aimsid) << INT_PARAM("buddy", getDword(hContact, "UIN")) + << CHAR_PARAM("r", pReq->m_reqId) << INT_PARAM("allGroups", 1); + pReq->flags |= NLHRF_NODUMPSEND; + Push(pReq); +} + //////////////////////////////////////////////////////////////////////////////////////// // PS_AddToList - adds a contact to the contact list @@ -225,7 +234,8 @@ INT_PTR CIcqProto::GetCaps(int type, MCONTACT hContact) int CIcqProto::GetInfo(MCONTACT hContact, int infoType) { - return 1; // Failure + RetrieveUserInfo(hContact); + return 0; } //////////////////////////////////////////////////////////////////////////////////////// @@ -244,49 +254,6 @@ HANDLE CIcqProto::SearchBasic(const wchar_t *pszSearch) return pReq; } -//////////////////////////////////////////////////////////////////////////////////////// -// SearchByEmail - searches the contact by its e-mail - -HANDLE CIcqProto::SearchByEmail(const wchar_t *email) -{ - return nullptr; // Failure -} - -//////////////////////////////////////////////////////////////////////////////////////// -// PS_SearchByName - searches the contact by its first or last name, or by a nickname - -HANDLE CIcqProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) -{ - return nullptr; // Failure -} - -HWND CIcqProto::CreateExtendedSearchUI(HWND parent) -{ - return nullptr; // Failure -} - -HWND CIcqProto::SearchAdvanced(HWND hwndDlg) -{ - return nullptr; // Failure -} - -//////////////////////////////////////////////////////////////////////////////////////// -// RecvContacts - -int CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) -{ - return 0; -} - -//////////////////////////////////////////////////////////////////////////////////////// -// SendContacts - -int CIcqProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hContactsList) -{ - // Exit with Failure - return 0; -} - //////////////////////////////////////////////////////////////////////////////////////// // SendFile - sends a file diff --git a/protocols/Icq10/src/proto.h b/protocols/Icq10/src/proto.h index f6346ac1b5..c2c217969e 100644 --- a/protocols/Icq10/src/proto.h +++ b/protocols/Icq10/src/proto.h @@ -170,14 +170,7 @@ class CIcqProto : public PROTO int GetInfo(MCONTACT hContact, int infoType) override; HANDLE SearchBasic(const wchar_t *id) override; - HANDLE SearchByEmail(const wchar_t *email) override; - HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override; - HWND SearchAdvanced(HWND owner) override; - HWND CreateExtendedSearchUI(HWND owner) override; - int RecvContacts(MCONTACT hContact, PROTORECVEVENT*) override; - - int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override; HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override; int SendMsg(MCONTACT hContact, int flags, const char *msg) override; int SendUrl(MCONTACT hContact, int flags, const char *url) override; @@ -191,6 +184,7 @@ class CIcqProto : public PROTO int UserIsTyping(MCONTACT hContact, int type) override; + void OnContactDeleted(MCONTACT) override; void OnModulesLoaded() override; void OnShutdown() override; -- cgit v1.2.3