diff options
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;
|