diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/requests/chatrooms.h | 9 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 7 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 20 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 2 |
4 files changed, 11 insertions, 27 deletions
diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h index 0eb5571be7..81151fd97a 100644 --- a/protocols/SkypeWeb/src/requests/chatrooms.h +++ b/protocols/SkypeWeb/src/requests/chatrooms.h @@ -105,15 +105,6 @@ struct InviteUserToChatRequest : public AsyncHttpRequest }
};
-struct KickUserRequest : public AsyncHttpRequest
-{
- KickUserRequest(const char *chatId, const char *skypename) :
- AsyncHttpRequest(REQUEST_DELETE, HOST_DEFAULT)
- {
- m_szUrl.AppendFormat("/threads/%s/members/%s", chatId, skypename);
- }
-};
-
struct SetChatPropertiesRequest : public AsyncHttpRequest
{
SetChatPropertiesRequest(const char *chatId, const char *propname, const char *value) :
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index d88bdc68bf..e5b75a7131 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -146,7 +146,7 @@ int CSkypeProto::OnGroupChatEventHook(WPARAM, LPARAM lParam) case GC_USER_NICKLISTMENU:
switch (gch->dwData) {
case 10:
- PushRequest(new KickUserRequest(chat_id, user_id));
+ KickChatUser(chat_id, user_id);
break;
case 30:
PushRequest(new InviteUserToChatRequest(chat_id, user_id, "Admin"));
@@ -470,6 +470,11 @@ void CSkypeProto::RemoveChatContact(SESSION_INFO *si, const wchar_t *id, bool is Chat_Event(&gce);
}
+void CSkypeProto::KickChatUser(const char *chatId, const char *userId)
+{
+ PushRequest(new AsyncHttpRequest(REQUEST_DELETE, HOST_DEFAULT, "/threads/" + mir_urlEncode(chatId) + "/members/" + mir_urlEncode(userId)));
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// Group chat creation dialog
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index fec21784af..e5e6038ba5 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -236,28 +236,14 @@ INT_PTR CSkypeProto::OnGrantAuth(WPARAM hContact, LPARAM) /////////////////////////////////////////////////////////////////////////////////////////
-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)) {
+ CMStringA szId(getId(hContact));
if (isChatRoom(hContact))
- PushRequest(new DestroyChatroomRequest(getId(hContact), m_szOwnSkypeId));
+ KickChatUser(szId, m_szOwnSkypeId);
else
- PushRequest(new DeleteContactRequest(getId(hContact)));
+ PushRequest(new AsyncHttpRequest(REQUEST_DELETE, HOST_CONTACTS, "/users/SELF/contacts/" + mir_urlEncode(szId)));
}
return true;
}
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index af1915eb6f..ced2d6771b 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -280,6 +280,8 @@ private: void RemoveChatContact(SESSION_INFO *si, const wchar_t *id, bool isKick = false, const wchar_t *initiator = L"");
void SendChatMessage(SESSION_INFO *si, const wchar_t *tszMessage);
+ void KickChatUser(const char *chatId, const char *userId);
+
void SetChatStatus(MCONTACT hContact, int iStatus);
// polling
|