From 70eb950138df0d3574695cfe7939d4c9b4ea2b9e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 22 Dec 2020 17:21:56 +0300 Subject: SkypeWeb: request to delete conversations --- protocols/SkypeWeb/src/requests/chatrooms.h | 9 +++++++++ protocols/SkypeWeb/src/skype_contacts.cpp | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'protocols/SkypeWeb/src') diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h index b8f6f48c82..f60831213c 100644 --- a/protocols/SkypeWeb/src/requests/chatrooms.h +++ b/protocols/SkypeWeb/src/requests/chatrooms.h @@ -76,6 +76,15 @@ struct CreateChatroomRequest : public AsyncHttpRequest } }; +struct DestroyChatroomRequest : public AsyncHttpRequest +{ + DestroyChatroomRequest(const char *room_id) : + AsyncHttpRequest(REQUEST_DELETE, HOST_DEFAULT) + { + m_szUrl.AppendFormat("/users/ME/conversations/%s/messages", room_id); + } +}; + struct GetChatInfoRequest : public AsyncHttpRequest { GetChatInfoRequest(const wchar_t *chatId) : diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index f45fd19a66..e0025d4126 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -237,9 +237,12 @@ INT_PTR CSkypeProto::OnGrantAuth(WPARAM hContact, LPARAM) void CSkypeProto::OnContactDeleted(MCONTACT hContact) { - if (IsOnline()) - if (hContact && !isChatRoom(hContact)) + if (IsOnline() && hContact) { + if (isChatRoom(hContact)) + PushRequest(new DestroyChatroomRequest(getMStringA(hContact, "ChatRoomID"))); + else PushRequest(new DeleteContactRequest(getId(hContact))); + } } INT_PTR CSkypeProto::BlockContact(WPARAM hContact, LPARAM) -- cgit v1.2.3