summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-12-22 17:21:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-12-22 17:21:56 +0300
commit70eb950138df0d3574695cfe7939d4c9b4ea2b9e (patch)
treee45f8bbaa7c63ccc88ac13a94afb87c740558e34
parent1f46c15ee7098125e34f5bc53a13c284211ef645 (diff)
SkypeWeb: request to delete conversations
-rw-r--r--protocols/SkypeWeb/src/requests/chatrooms.h9
-rw-r--r--protocols/SkypeWeb/src/skype_contacts.cpp7
2 files changed, 14 insertions, 2 deletions
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)