diff options
author | George Hazan <george.hazan@gmail.com> | 2024-09-17 15:54:13 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-09-17 15:54:13 +0300 |
commit | 179f341b7b5be2b48e690c7f7289bd1ce3dc1739 (patch) | |
tree | 75bd7ac86ea6e7c4f4ecd47f8366f2201de53f9d /protocols/SkypeWeb/src/skype_contacts.cpp | |
parent | 65c3a1882c6855158988620ac29a53f698a137b1 (diff) |
SkypeWeb: fix for leaving group chat
Diffstat (limited to 'protocols/SkypeWeb/src/skype_contacts.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index bcf8e76a1f..fec21784af 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -234,17 +234,36 @@ INT_PTR CSkypeProto::OnGrantAuth(WPARAM hContact, LPARAM) return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
+struct DestroyChatroomRequest : public AsyncHttpRequest
+{
+ DestroyChatroomRequest(const char *room_id, const char *user_id) :
+ AsyncHttpRequest(REQUEST_DELETE, HOST_DEFAULT, "/threads/" + mir_urlEncode(room_id) + "/members/" + mir_urlEncode(user_id))
+ {}
+};
+
+struct DeleteContactRequest : public AsyncHttpRequest
+{
+ DeleteContactRequest(const char *who) :
+ AsyncHttpRequest(REQUEST_DELETE, HOST_CONTACTS, "/users/SELF/contacts/" + mir_urlEncode(who))
+ {
+ }
+};
+
bool CSkypeProto::OnContactDeleted(MCONTACT hContact, uint32_t flags)
{
if (IsOnline() && hContact && (flags & CDF_DEL_CONTACT)) {
if (isChatRoom(hContact))
- PushRequest(new DestroyChatroomRequest(getId(hContact)));
+ PushRequest(new DestroyChatroomRequest(getId(hContact), m_szOwnSkypeId));
else
PushRequest(new DeleteContactRequest(getId(hContact)));
}
return true;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
INT_PTR CSkypeProto::BlockContact(WPARAM hContact, LPARAM)
{
if (!IsOnline()) return 1;
|