summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/requests/status.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb/src/requests/status.h')
-rw-r--r--protocols/SkypeWeb/src/requests/status.h41
1 files changed, 5 insertions, 36 deletions
diff --git a/protocols/SkypeWeb/src/requests/status.h b/protocols/SkypeWeb/src/requests/status.h
index 2f0f9f4f42..1fc30bac81 100644
--- a/protocols/SkypeWeb/src/requests/status.h
+++ b/protocols/SkypeWeb/src/requests/status.h
@@ -1,16 +1,16 @@
#ifndef _SKYPE_REQUEST_STATUS_H_
#define _SKYPE_REQUEST_STATUS_H_
-class SetStatusRequest : public HttpsRequest
+class SetStatusRequest : public HttpRequest
{
public:
- SetStatusRequest(const char *regToken, int status) :
- HttpsRequest(REQUEST_PUT, "client-s.gateway.messenger.live.com/v1/users/ME/presenceDocs/messagingService")
+ SetStatusRequest(const char *regToken, const char *status) :
+ HttpRequest(REQUEST_PUT, "client-s.gateway.messenger.live.com/v1/users/ME/presenceDocs/messagingService")
{
CMStringA auth = "registrationToken=";
auth += regToken;
Headers
- << CHAR_VALUE("Accept", "application / json, text / javascript")
+ << CHAR_VALUE("Accept", "application/json, text/javascript")
<< CHAR_VALUE("Expires", "0")
<< CHAR_VALUE("RegistrationToken", auth)
<< CHAR_VALUE("Content-Type", "application/json; charset = UTF-8")
@@ -19,38 +19,7 @@ public:
<< CHAR_VALUE("Origin", "https://web.skype.com")
<< CHAR_VALUE("Connection", "keep-alive");
- const char *data;
- switch (status)
- {
- case ID_STATUS_ONLINE:
- {
- data = "{\"status\":\"Online\"}";
- break;
- }
- case ID_STATUS_AWAY:
- {
- data = "{\"status\":\"Away\"}";
- break;
- }
- case ID_STATUS_DND:
- {
- data = "{\"status\":\"Busy\"}";
- break;
- }
- case ID_STATUS_IDLE:
- {
- data = "{\"status\":\"Idle\"}";
- break;
- }
- case ID_STATUS_INVISIBLE:
- {
- data = "{\"status\":\"Hidden\"}";
- break;
- }
- default:
- data = "{\"status\":\"Online\"}";
- }
- Body << VALUE(data);
+ Body << FORMAT_VALUE("{\"status\":\"%s\"}", status);
}
};