diff options
Diffstat (limited to 'protocols/SkypeWeb/src/skype_trouter.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_trouter.cpp | 59 |
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 |