diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-28 18:01:26 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-28 18:01:26 +0000 |
commit | ae0977cb9a995e26abd4c9335aa51d318bc4a93b (patch) | |
tree | 2b949c13f16a6b09892ae192c683038ea6d28c87 | |
parent | 298933908c6a33315b64d7c3ac51dc47a42ee553 (diff) |
SkypeWeb: TRouter support part 0.1.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13232 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/SkypeWeb/SkypeWeb_10.vcxproj | 10 | ||||
-rw-r--r-- | protocols/SkypeWeb/SkypeWeb_10.vcxproj.filters | 14 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/common.h | 1 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/trouter.h | 57 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_trouter.cpp | 18 |
5 files changed, 92 insertions, 8 deletions
diff --git a/protocols/SkypeWeb/SkypeWeb_10.vcxproj b/protocols/SkypeWeb/SkypeWeb_10.vcxproj index 89f4162b2a..41f94cfeef 100644 --- a/protocols/SkypeWeb/SkypeWeb_10.vcxproj +++ b/protocols/SkypeWeb/SkypeWeb_10.vcxproj @@ -213,6 +213,7 @@ <ClInclude Include="src\requests\search.h" />
<ClInclude Include="src\requests\status.h" />
<ClInclude Include="src\requests\subscriptions.h" />
+ <ClInclude Include="src\requests\trouter.h" />
<ClInclude Include="src\resource.h" />
<ClInclude Include="src\skype_dialogs.h" />
<ClInclude Include="src\skype_icons.h" />
@@ -232,6 +233,7 @@ <ClCompile Include="src\skype_poll_processing.cpp" />
<ClCompile Include="src\skype_profile.cpp" />
<ClCompile Include="src\skype_request.cpp" />
+ <ClCompile Include="src\skype_trouter.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
@@ -252,10 +254,10 @@ </ItemGroup>
<ItemGroup>
<Image Include="res\Icons\skype.ico" />
- <Image Include="res\Icons\conference.ico" />
- <Image Include="res\Icons\sync_history.ico" />
- <Image Include="res\Icons\user_block.ico" />
- <Image Include="res\Icons\user_unblock.ico" />
+ <Image Include="res\Icons\conference.ico" />
+ <Image Include="res\Icons\sync_history.ico" />
+ <Image Include="res\Icons\user_block.ico" />
+ <Image Include="res\Icons\user_unblock.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
diff --git a/protocols/SkypeWeb/SkypeWeb_10.vcxproj.filters b/protocols/SkypeWeb/SkypeWeb_10.vcxproj.filters index d3efd5bb68..8b8ed36817 100644 --- a/protocols/SkypeWeb/SkypeWeb_10.vcxproj.filters +++ b/protocols/SkypeWeb/SkypeWeb_10.vcxproj.filters @@ -87,6 +87,9 @@ <ClInclude Include="src\requests\chatrooms.h">
<Filter>Header Files\requests</Filter>
</ClInclude>
+ <ClInclude Include="src\requests\trouter.h">
+ <Filter>Header Files\requests</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\stdafx.cpp">
@@ -149,6 +152,9 @@ <ClCompile Include="src\skype_chatrooms.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\skype_trouter.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc">
@@ -162,16 +168,16 @@ <Image Include="res\icons\skype.ico">
<Filter>Resource Files\Icons</Filter>
</Image>
- <Image Include="res\Icons\sync_history.ico">
+ <Image Include="res\Icons\sync_history.ico">
<Filter>Resource Files\Icons</Filter>
</Image>
- <Image Include="res\Icons\conference.ico">
+ <Image Include="res\Icons\conference.ico">
<Filter>Resource Files\Icons</Filter>
</Image>
- <Image Include="res\Icons\user_block.ico">
+ <Image Include="res\Icons\user_block.ico">
<Filter>Resource Files\Icons</Filter>
</Image>
- <Image Include="res\Icons\user_unblock.ico">
+ <Image Include="res\Icons\user_unblock.ico">
<Filter>Resource Files\Icons</Filter>
</Image>
</ItemGroup>
diff --git a/protocols/SkypeWeb/src/common.h b/protocols/SkypeWeb/src/common.h index 6e85e35f10..820bfc029c 100644 --- a/protocols/SkypeWeb/src/common.h +++ b/protocols/SkypeWeb/src/common.h @@ -82,6 +82,7 @@ struct CSkypeProto; #include "requests\avatars.h"
#include "requests\search.h"
#include "requests\chatrooms.h"
+#include "requests\trouter.h"
#include "request_queue.h"
#include "skype_proto.h"
diff --git a/protocols/SkypeWeb/src/requests/trouter.h b/protocols/SkypeWeb/src/requests/trouter.h new file mode 100644 index 0000000000..833c1d850f --- /dev/null +++ b/protocols/SkypeWeb/src/requests/trouter.h @@ -0,0 +1,57 @@ +/*
+Copyright (c) 2015 Miranda NG project (http://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+class CreateTrouterRequest : public HttpRequest
+{
+public:
+ CreateTrouterRequest() :
+ HttpRequest(REQUEST_POST,"go.trouter.io/v1/users/ME/endpoints")
+ {
+ Headers
+ << CHAR_VALUE("Accept", "application/json, text/javascript, text/html,application/xhtml+xml, application/xml");
+ //{"secure":true,"ccid":"huzHTfsZt3wZ","connId":"AUKRNgA8_eKV0Ibsx037Gbd8GVrsDg8zLQRt1pH8sCyIAile3gtoWmlq2x1yZ_VNZ3tf","healthUrl":"https://go.trouter.io:443/v2/h","id":"QpE2ADz94pXQhuzHTfsZt3wZ","instance":"193.149.88.131","instancePort":443,"socketio":"https://193-149-88-131.drip.trouter.io:443/","surl":"https://193-149-88-131.drip.trouter.io:8443/v2/f/QpE2ADz94pXQhuzHTfsZt3wZ/","url":"https://193-149-88-131.drip.trouter.io:443/v2/f/QpE2ADz94pXQhuzHTfsZt3wZ/"}
+ }
+};
+
+class CreatePoliciesRequest : public HttpRequest
+{
+public:
+ CreatePoliciesRequest(const char *token, const char *sr) :
+ HttpRequest(REQUEST_POST, FORMAT, "prod.tpc.skype.com/v1/policies")
+ {
+ Headers
+ << CHAR_VALUE("Accept", "application/json, text/javascript")
+ << CHAR_VALUE("Content-Type", "application/json; charset=UTF-8")
+ << CHAR_VALUE("X-Skypetoken", token);
+
+ JSONNODE *node = json_new(5);
+ json_push_back(node, json_new_a("sr", sr));
+ ptrA data(mir_utf8encodeT(ptrT(json_write(node))));
+
+ Body << VALUE(data);
+
+ json_delete(node);
+ }
+ //{"sr":"AUKRNgA8_eKV0Ibsx037Gbd8GVrsDg8zLQRt1pH8sCyIAile3gtoWmlq2x1yZ_VNZ3tf","issuer":"edf","sp":"connect","st":"1430236511619","se":"1430318082619","sig":"nYczCdlBENCxoAFLy7lPkGELVV1w5TcUnpSUE2G7GLA"}
+};
+
+//GET https://193-149-88-131.drip.trouter.io/socket.io/1/?sr=AUKRNgA8_eKV0Ibsx037Gbd8GVrsDg8zLQRt1pH8sCyIAile3gtoWmlq2x1yZ_VNZ3tf&issuer=edf&sp=connect&st=1430236511619&se=1430318082619&sig=nYczCdlBENCxoAFLy7lPkGELVV1w5TcUnpSUE2G7GLA&r=193.149.88.131&v=v2&p=443&ccid=huzHTfsZt3wZ&dom=web.skype.com&tc=%7B%22cv%22:%222014.8.26%22,%22hr%22:%22%22,%22ua%22:%22SWX%22,%22v%22:%221.2.273%22%7D&t=1430236827898 HTTP/1.1
+//3725b0e4-a8b6-49c9-9cf1-6bef4672fe7a:150:150:websocket,xhr-polling,jsonp-polling
+// ^ supported
+//GET https://193-149-88-131.drip.trouter.io/socket.io/1/websocket/3725b0e4-a8b6-49c9-9cf1-6bef4672fe7a?sr=AUKRNgA8_eKV0Ibsx037Gbd8GVrsDg8zLQRt1pH8sCyIAile3gtoWmlq2x1yZ_VNZ3tf&issuer=edf&sp=connect&st=1430236511619&se=1430318082619&sig=nYczCdlBENCxoAFLy7lPkGELVV1w5TcUnpSUE2G7GLA&r=193.149.88.131&v=v2&p=443&ccid=huzHTfsZt3wZ&dom=web.skype.com&tc=%7B%22cv%22:%222014.8.26%22,%22hr%22:%22%22,%22ua%22:%22SWX%22,%22v%22:%221.2.273%22%7D HTTP/1.1
+//is websocket
+//
diff --git a/protocols/SkypeWeb/src/skype_trouter.cpp b/protocols/SkypeWeb/src/skype_trouter.cpp new file mode 100644 index 0000000000..a546bc07eb --- /dev/null +++ b/protocols/SkypeWeb/src/skype_trouter.cpp @@ -0,0 +1,18 @@ +/*
+Copyright (c) 2015 Miranda NG project (http://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+#include "common.h"
+
|