summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_trouter.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-04-29 13:54:24 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-04-29 13:54:24 +0000
commitd667adb8f13d6e8917c225260631ad6905c3fbcf (patch)
tree2d9e8f59b19274b45b1bc150ecd265ee2240182a /protocols/SkypeWeb/src/skype_trouter.cpp
parent89113840fb4160af43bbc6cc22b1b13c5118259d (diff)
SkypeWeb: TRouter support part 0.2.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13241 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_trouter.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_trouter.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp
index a546bc07eb..c1c2b33468 100644
--- a/protocols/SkypeWeb/src/skype_trouter.cpp
+++ b/protocols/SkypeWeb/src/skype_trouter.cpp
@@ -16,3 +16,62 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "common.h"
+void CSkypeProto::OnCreateTrouter(const NETLIBHTTPREQUEST *response)
+{
+ if (response == NULL || response->pData == NULL)
+ return;
+
+ JSONROOT root(response->pData);
+
+ ptrA ccid(mir_t2a(ptrT(json_as_string(json_get(root, "ccid")))));
+ ptrA connId(mir_t2a(ptrT(json_as_string(json_get(root, "connId")))));
+ ptrA id(mir_t2a(ptrT(json_as_string(json_get(root, "cid")))));
+ ptrA instance(mir_t2a(ptrT(json_as_string(json_get(root, "instance")))));
+ ptrA socketio(mir_t2a(ptrT(json_as_string(json_get(root, "socketio")))));
+
+ setString("Trouter_ccid", ccid);
+ setString("Trouter_connId", connId);
+ setString("Trouter_id", id);
+ setString("Trouter_instance", instance);
+ setString("Trouter_socketio", socketio);
+
+ SendRequest(new CreateTrouterPoliciesRequest(TokenSecret, connId), &CSkypeProto::OnTrouterPoliciesCreated);
+}
+
+void CSkypeProto::OnTrouterPoliciesCreated(const NETLIBHTTPREQUEST *response)
+{
+ if (response == NULL || response->pData == NULL)
+ return;
+
+ JSONROOT root(response->pData);
+
+ int st = _ttoi(json_as_string(json_get(root, "st")));
+ int se = _ttoi(json_as_string(json_get(root, "se")));
+ ptrA sig(mir_t2a(ptrT(json_as_string(json_get(root, "sig")))));
+
+ SendRequest(new GetTrouterRequest
+ (
+ getStringA("Trouter_socketio"),
+ getStringA("Trouter_connId"),
+ st, se, sig,
+ getStringA("Trouter_instance"),
+ getStringA("Trouter_ccid")
+ ));
+
+
+}
+
+void CSkypeProto::OnGetTrouter(const NETLIBHTTPREQUEST *response)
+{
+ if (response == NULL || response->pData == NULL)
+ return;
+ CMStringA data(response->pData);
+ int iStart = 0;
+ CMStringA szToken = data.Tokenize(";", iStart).Trim();
+ setString("Trouter_SessId", szToken);
+}
+
+void CSkypeProto::TRouterThread(void*)
+{
+
+} \ No newline at end of file