summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/requests
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-03-18 20:28:01 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-03-18 20:28:01 +0000
commit3364fd6b8bdc21692805302a4333e49b44590b2c (patch)
tree578dd1a7a5db05311add225a78c65cc2a7b03f6d /protocols/SkypeWeb/src/requests
parentcd4a3aab6a6406bcaca07734848e57477db4485d (diff)
SkypeWeb:
- contact list loading - refactoring git-svn-id: http://svn.miranda-ng.org/main/trunk@12431 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests')
-rw-r--r--protocols/SkypeWeb/src/requests/contacts.h17
-rw-r--r--protocols/SkypeWeb/src/requests/login.h4
2 files changed, 19 insertions, 2 deletions
diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h
new file mode 100644
index 0000000000..3ba86d9b2e
--- /dev/null
+++ b/protocols/SkypeWeb/src/requests/contacts.h
@@ -0,0 +1,17 @@
+#ifndef _SKYPE_REQUEST_CONTACTS_H_
+#define _SKYPE_REQUEST_CONTACTS_H_
+
+class GetContactsRequest : public HttpRequest
+{
+public:
+ GetContactsRequest(const char *token) :
+ HttpRequest(REQUEST_GET, "api.skype.com/users/self/contacts")
+ {
+ flags |= NLHRF_SSL;
+
+ AddHeader("X-Skypetoken", token);
+ AddHeader("Accept", "application/json");
+ }
+};
+
+#endif //_SKYPE_REQUEST_CONTACTS_H_
diff --git a/protocols/SkypeWeb/src/requests/login.h b/protocols/SkypeWeb/src/requests/login.h
index e1d94806b7..73003b5046 100644
--- a/protocols/SkypeWeb/src/requests/login.h
+++ b/protocols/SkypeWeb/src/requests/login.h
@@ -12,7 +12,7 @@ public:
url.Append("?client_id=578134&redirect_uri=https%3A%2F%2Fweb.skype.com");
}
- LoginRequest(const char *username, const char *password, const char *pie, const char *etm) :
+ LoginRequest(const char *skypename, const char *password, const char *pie, const char *etm) :
HttpRequest(REQUEST_POST, "login.skype.com/login")
{
flags |= NLHRF_SSL;
@@ -26,7 +26,7 @@ public:
int minutes = tzi->Bias % -60;
CMStringA data = "";
- data.AppendFormat("username=%s&", username);
+ data.AppendFormat("username=%s&", skypename);
data.AppendFormat("password=%s&", password);
data.AppendFormat("pie=%s&", ptrA(mir_urlEncode(pie)));
data.AppendFormat("etm=%s&", ptrA(mir_urlEncode(etm)));