summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/requests/login.h
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-03-17 20:33:47 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-03-17 20:33:47 +0000
commitdd3d0e59dcd34beb222fcf612a51d3fee82c0e43 (patch)
tree0ae5a6e0a83399036d1452256ee3f89dc6da8872 /protocols/SkypeWeb/src/requests/login.h
parent076fa9b3142f55fc736fbf58b20bfa45973acd68 (diff)
SkypeWeb: initial commit
git-svn-id: http://svn.miranda-ng.org/main/trunk@12424 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests/login.h')
-rw-r--r--protocols/SkypeWeb/src/requests/login.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/requests/login.h b/protocols/SkypeWeb/src/requests/login.h
new file mode 100644
index 0000000000..e1d94806b7
--- /dev/null
+++ b/protocols/SkypeWeb/src/requests/login.h
@@ -0,0 +1,44 @@
+#ifndef _SKYPE_REQUEST_LOGIN_H_
+#define _SKYPE_REQUEST_LOGIN_H_
+
+class LoginRequest : public HttpRequest
+{
+public:
+ LoginRequest() :
+ HttpRequest(REQUEST_POST, "login.skype.com/login")
+ {
+ flags |= NLHRF_SSL;
+
+ 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) :
+ HttpRequest(REQUEST_POST, "login.skype.com/login")
+ {
+ flags |= NLHRF_SSL;
+
+ url.Append("?client_id=578134&redirect_uri=https%3A%2F%2Fweb.skype.com");
+
+ LPTIME_ZONE_INFORMATION tzi = tmi.getTziByContact(NULL);
+
+ char sign = tzi->Bias > 0 ? '-' : '+';
+ int hours = tzi->Bias / -60;
+ int minutes = tzi->Bias % -60;
+
+ CMStringA data = "";
+ data.AppendFormat("username=%s&", username);
+ data.AppendFormat("password=%s&", password);
+ data.AppendFormat("pie=%s&", ptrA(mir_urlEncode(pie)));
+ data.AppendFormat("etm=%s&", ptrA(mir_urlEncode(etm)));
+ data.AppendFormat("timezone_field=%c%02d|%02d&", sign, hours, minutes);
+ data.AppendFormat("js_time=%d.00&", time(NULL));
+ data.Append("client_id=578134&");
+ data.Append("redirect_uri=https%3A%2F%2Fweb.skype.com");
+
+ SetData(data, data.GetLength());
+
+ AddHeader("Content-Type", "application/x-www-form-urlencoded");
+ }
+};
+
+#endif //_SKYPE_REQUEST_LOGIN_H_