From fff952e50f44761fa85ca90819ac97c47e77b553 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Tue, 14 Apr 2015 12:35:37 +0000 Subject: SkypeWeb: More improvements. git-svn-id: http://svn.miranda-ng.org/main/trunk@12802 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/requests/contacts.h | 5 +++-- protocols/SkypeWeb/src/requests/endpoint.h | 6 +++--- protocols/SkypeWeb/src/requests/messages.h | 23 ++++------------------- 3 files changed, 10 insertions(+), 24 deletions(-) (limited to 'protocols/SkypeWeb/src/requests') diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h index ce16179d95..af39438ffd 100644 --- a/protocols/SkypeWeb/src/requests/contacts.h +++ b/protocols/SkypeWeb/src/requests/contacts.h @@ -100,9 +100,10 @@ public: { Headers << CHAR_VALUE("X-Skypetoken", token) - << CHAR_VALUE("Accept", "application/json"); + << CHAR_VALUE("Accept", "application/json") + << CHAR_VALUE("Content-type", "application/x-www-form-urlencoded"); CMStringA data; - data.AppendFormat("greeting=%s", mir_urlEncode(greeting)); + data.AppendFormat("greeting=%s", ptrA(mir_urlEncode(greeting))); Body << VALUE(data); } }; diff --git a/protocols/SkypeWeb/src/requests/endpoint.h b/protocols/SkypeWeb/src/requests/endpoint.h index 635820e0f0..428a727b5b 100644 --- a/protocols/SkypeWeb/src/requests/endpoint.h +++ b/protocols/SkypeWeb/src/requests/endpoint.h @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _SKYPE_REQUEST_REGINFO_H_ -#define _SKYPE_REQUEST_REGINFO_H_ +#ifndef _SKYPE_REQUEST_ENDPOINT_H_ +#define _SKYPE_REQUEST_ENDPOINT_H_ class CreateEndpointRequest : public HttpRequest { @@ -33,4 +33,4 @@ public: } }; -#endif //_SKYPE_REQUEST_STATUS_H_ +#endif //_SKYPE_REQUEST_ENDPOINT_H_ diff --git a/protocols/SkypeWeb/src/requests/messages.h b/protocols/SkypeWeb/src/requests/messages.h index 1eb0115ae3..de6d044305 100644 --- a/protocols/SkypeWeb/src/requests/messages.h +++ b/protocols/SkypeWeb/src/requests/messages.h @@ -28,7 +28,6 @@ public: << CHAR_VALUE("Accept", "application/json, text/javascript") << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken) << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8"); - JSONNODE *node = json_new(5); json_push_back(node, json_new_i("clientmessageid", timestamp)); json_push_back(node, json_new_a("messagetype", "RichText")); @@ -79,7 +78,7 @@ public: Headers << CHAR_VALUE("Accept", "application/json, text/javascript") << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken) - << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8"); + << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8"); char *state = (iState == PROTOTYPE_SELFTYPING_ON) ? "Control/Typing" : "Control/ClearTyping"; @@ -96,11 +95,11 @@ public: } }; -class GetHistoryRequest : public HttpRequest +class MarkMessageReadRequest : public HttpRequest { public: - GetHistoryRequest(const char *regToken, const char *username, LONGLONG timestamp = 0, const char *server = SKYPE_ENDPOINTS_HOST) : - HttpRequest(REQUEST_GET, FORMAT, "%s/v1/users/ME/conversations/8:%s/messages?startTime=%d&pageSize=100&view=msnp24Equivalent&targetType=Passport|Skype|Lync|Thread", server, ptrA(mir_urlEncode(username)), timestamp) + MarkMessageReadRequest(const char *regToken, const char *username, LONGLONG msgId = 0, const char *server = SKYPE_ENDPOINTS_HOST) : + HttpRequest(REQUEST_GET, FORMAT, "%s/v1/users/ME/conversations/8:%s/messages/%lld", server, ptrA(mir_urlEncode(username)), msgId) { Headers << CHAR_VALUE("Accept", "application/json, text/javascript") @@ -108,18 +107,4 @@ public: << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8"); } }; - -class SyncHistoryFirstRequest : public HttpRequest -{ -public: - SyncHistoryFirstRequest(const char *regToken, const char *server = SKYPE_ENDPOINTS_HOST) : - HttpRequest(REQUEST_GET, FORMAT, "%s/v1/users/ME/conversations?startTime=0&pageSize=100&view=msnp24Equivalent&targetType=Passport|Skype|Lync|Thread", server) - { - Headers - << CHAR_VALUE("Accept", "application/json, text/javascript") - << FORMAT_VALUE("RegistrationToken", "registrationToken=%s", regToken) - << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8"); - } -}; - #endif //_SKYPE_REQUEST_MESSAGES_H_ -- cgit v1.2.3