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 | |
parent | 65c3a1882c6855158988620ac29a53f698a137b1 (diff) |
SkypeWeb: fix for leaving group chat
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/requests/chatrooms.h | 9 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/contacts.h | 9 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 21 |
4 files changed, 21 insertions, 22 deletions
diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h index 4e12b0c331..0eb5571be7 100644 --- a/protocols/SkypeWeb/src/requests/chatrooms.h +++ b/protocols/SkypeWeb/src/requests/chatrooms.h @@ -66,15 +66,6 @@ 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 GetChatMembersRequest : public AsyncHttpRequest
{
GetChatMembersRequest(const LIST<char> &ids, SESSION_INFO *si) :
diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h index 2fab52b21d..6256087559 100644 --- a/protocols/SkypeWeb/src/requests/contacts.h +++ b/protocols/SkypeWeb/src/requests/contacts.h @@ -45,15 +45,6 @@ struct AddContactRequest : public AsyncHttpRequest }
};
-struct DeleteContactRequest : public AsyncHttpRequest
-{
- DeleteContactRequest(const char *who) :
- AsyncHttpRequest(REQUEST_DELETE, HOST_CONTACTS)
- {
- m_szUrl.AppendFormat("/users/SELF/contacts/%s", mir_urlEncode(who).c_str());
- }
-};
-
struct AuthAcceptRequest : public AsyncHttpRequest
{
AuthAcceptRequest(const char *who) :
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index d9e94c9f11..d88bdc68bf 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -218,9 +218,7 @@ INT_PTR CSkypeProto::OnLeaveChatRoom(WPARAM hContact, LPARAM) Chat_Control(si, SESSION_OFFLINE);
Chat_Terminate(si);
- PushRequest(new KickUserRequest(_T2A(idT), m_szSkypename));
-
- db_delete_contact(hContact, CDF_FROM_SERVER);
+ db_delete_contact(hContact, CDF_DEL_CONTACT);
}
return 0;
}
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;
|