From aed7583d1b058a421d95d34719ec398bd40bd760 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 26 Apr 2015 12:51:25 +0000 Subject: SkypeWeb: Contacts removing. git-svn-id: http://svn.miranda-ng.org/main/trunk@13167 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/requests/subscriptions.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'protocols/SkypeWeb/src/requests/subscriptions.h') diff --git a/protocols/SkypeWeb/src/requests/subscriptions.h b/protocols/SkypeWeb/src/requests/subscriptions.h index d0d896b7c1..2490329140 100644 --- a/protocols/SkypeWeb/src/requests/subscriptions.h +++ b/protocols/SkypeWeb/src/requests/subscriptions.h @@ -34,4 +34,25 @@ public: } }; +class CreateContactsSubscriptionRequest : public HttpRequest +{ +public: + CreateContactsSubscriptionRequest(const char *regToken, const LIST &skypenames, const char *server = SKYPE_ENDPOINTS_HOST) : + 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); + } +}; + #endif //_SKYPE_REQUEST_SUBSCIPTIONS_H_ -- cgit v1.2.3