From 90a05404a6ded56141c0230f663686439f8fa146 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Tue, 7 Apr 2015 21:50:05 +0000 Subject: SkypeWeb: - added ability to getting contacts statuses - partly reworked login flow git-svn-id: http://svn.miranda-ng.org/main/trunk@12665 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/requests/contacts.h | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'protocols/SkypeWeb/src/requests/contacts.h') diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h index 8a23526bf9..585df9a92d 100644 --- a/protocols/SkypeWeb/src/requests/contacts.h +++ b/protocols/SkypeWeb/src/requests/contacts.h @@ -30,6 +30,39 @@ public: } }; +class GetContactStatusRequest : public HttpRequest +{ +public: + GetContactStatusRequest(const char *regToken, const char *skypename, const char *server = "client-s.gateway.messenger.live.com") : + HttpRequest(REQUEST_GET, FORMAT, "%s/v1/users/ME/contacts/8:%s/presenceDocs/messagingService", server, skypename) + { + Headers + << CHAR_VALUE("Accept", "application/json, text/javascript") + << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken); + } +}; + +class CreateContactsRequest : public HttpRequest +{ +public: + CreateContactsRequest(const char *regToken, const LIST &skypenames, const char *server = "client-s.gateway.messenger.live.com") : + HttpRequest(REQUEST_POST, FORMAT, "%s/v1/users/ME/contacts", server) + { + Headers + << CHAR_VALUE("Accept", "application/json, text/javascript") + << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8") + << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken); + + CMStringA data = "{\"contacts\":["; + for (int i = 0; i < skypenames.getCount(); i++) + data.AppendFormat("{\"id\":\"8:%s\"},", skypenames[i]); + data.Truncate(data.GetLength() - 1); + data.Append("]}"); + + Body << VALUE(data); + } +}; + class GetContactsAuthRequest : public HttpRequest { public: -- cgit v1.2.3