diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/SkypeWeb.vcxproj | 18 | ||||
-rw-r--r-- | protocols/SkypeWeb/SkypeWeb.vcxproj.filters | 9 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/requests/files.h (renamed from protocols/SkypeWeb/src/requests/asm/files.h) | 90 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/stdafx.h | 23 |
4 files changed, 67 insertions, 73 deletions
diff --git a/protocols/SkypeWeb/SkypeWeb.vcxproj b/protocols/SkypeWeb/SkypeWeb.vcxproj index 2cae8ae42e..270e4e15d3 100644 --- a/protocols/SkypeWeb/SkypeWeb.vcxproj +++ b/protocols/SkypeWeb/SkypeWeb.vcxproj @@ -26,23 +26,7 @@ <Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" />
</ImportGroup>
<ItemGroup>
- <ClInclude Include="src\requests\avatars.h" />
- <ClInclude Include="src\requests\capabilities.h" />
- <ClInclude Include="src\requests\chatrooms.h" />
- <ClInclude Include="src\requests\contacts.h" />
- <ClInclude Include="src\requests\endpoint.h" />
- <ClInclude Include="src\requests\history.h" />
- <ClInclude Include="src\requests\login.h" />
- <ClInclude Include="src\requests\messages.h" />
- <ClInclude Include="src\requests\poll.h" />
- <ClInclude Include="src\requests\profile.h" />
- <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\requests\mslogin.h" />
- <ClInclude Include="src\requests\oauth.h" />
- <ClInclude Include="src\requests\asm\files.h" />
+ <ClInclude Include="src\requests\*.h" />
</ItemGroup>
<ItemDefinitionGroup>
<ClCompile>
diff --git a/protocols/SkypeWeb/SkypeWeb.vcxproj.filters b/protocols/SkypeWeb/SkypeWeb.vcxproj.filters index 7ef90967de..4788f4e7ac 100644 --- a/protocols/SkypeWeb/SkypeWeb.vcxproj.filters +++ b/protocols/SkypeWeb/SkypeWeb.vcxproj.filters @@ -1,10 +1,19 @@ <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Header Files\Requests">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFC}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ </ItemGroup>
<Import Project="$(ProjectDir)..\..\build\vc.common\common.filters" />
<ItemGroup>
<ClInclude Include="src\*.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="src\requests\*.h">
+ <Filter>Header Files\Requests</Filter>
+ </ClInclude>
<ClCompile Include="src\*.cpp;src\*.cxx">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/protocols/SkypeWeb/src/requests/asm/files.h b/protocols/SkypeWeb/src/requests/files.h index c5bcf7373a..f7404474a2 100644 --- a/protocols/SkypeWeb/src/requests/asm/files.h +++ b/protocols/SkypeWeb/src/requests/files.h @@ -1,45 +1,45 @@ -#pragma once
-
-class ASMObjectCreateRequest : public HttpRequest
-{
-public:
- ASMObjectCreateRequest(CSkypeProto *ppro, const char *szContact, const char *szFileName) :
- HttpRequest(REQUEST_POST, "api.asm.skype.com/v1/objects")
- {
- flags &= (~NLHRF_DUMPASTEXT);
- Headers
- << FORMAT_VALUE("Authorization", "skype_token %s", ppro->m_szApiToken.get())
- << CHAR_VALUE("Content-Type", "text/json")
- << CHAR_VALUE("X-Client-Version", "0/0.0.0.0");
-
- JSONNode node, jPermissions, jPermission(JSON_ARRAY);
- jPermissions.set_name("permissions");
- jPermission.set_name(szContact);
- jPermission << JSONNode("", "read");
- jPermissions << jPermission;
- node << JSONNode("type", "sharing/file") << JSONNode("filename", szFileName) << jPermissions;
-
- Body << VALUE(node.write().c_str());
- }
-};
-
-class ASMObjectUploadRequest : public HttpRequest
-{
-public:
- ASMObjectUploadRequest(CSkypeProto *ppro, const char *szObject, const PBYTE data, const size_t size) :
- HttpRequest(REQUEST_PUT, FORMAT, "api.asm.skype.com/v1/objects/%s/content/original", szObject)
- {
- Headers
- << FORMAT_VALUE("Authorization", "skype_token %s", ppro->m_szApiToken.get())
- << CHAR_VALUE("Content-Type", "application/octet-stream");
-
- pData = (char*)mir_alloc(size);
- memcpy(pData, data, size);
- dataLength = (int)size;
-
- }
- ~ASMObjectUploadRequest()
- {
- mir_free(pData);
- }
-};
+#pragma once + +class ASMObjectCreateRequest : public HttpRequest +{ +public: + ASMObjectCreateRequest(CSkypeProto *ppro, const char *szContact, const char *szFileName) : + HttpRequest(REQUEST_POST, "api.asm.skype.com/v1/objects") + { + flags &= (~NLHRF_DUMPASTEXT); + Headers + << FORMAT_VALUE("Authorization", "skype_token %s", ppro->m_szApiToken.get()) + << CHAR_VALUE("Content-Type", "text/json") + << CHAR_VALUE("X-Client-Version", "0/0.0.0.0"); + + JSONNode node, jPermissions, jPermission(JSON_ARRAY); + jPermissions.set_name("permissions"); + jPermission.set_name(szContact); + jPermission << JSONNode("", "read"); + jPermissions << jPermission; + node << JSONNode("type", "sharing/file") << JSONNode("filename", szFileName) << jPermissions; + + Body << VALUE(node.write().c_str()); + } +}; + +class ASMObjectUploadRequest : public HttpRequest +{ +public: + ASMObjectUploadRequest(CSkypeProto *ppro, const char *szObject, const PBYTE data, const size_t size) : + HttpRequest(REQUEST_PUT, FORMAT, "api.asm.skype.com/v1/objects/%s/content/original", szObject) + { + Headers + << FORMAT_VALUE("Authorization", "skype_token %s", ppro->m_szApiToken.get()) + << CHAR_VALUE("Content-Type", "application/octet-stream"); + + pData = (char*)mir_alloc(size); + memcpy(pData, data, size); + dataLength = (int)size; + + } + ~ASMObjectUploadRequest() + { + mir_free(pData); + } +}; diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h index 433a38c1ab..ebaff8d4bb 100644 --- a/protocols/SkypeWeb/src/stdafx.h +++ b/protocols/SkypeWeb/src/stdafx.h @@ -94,23 +94,24 @@ struct MessageId #include "skype_db.h"
#include "http_request.h"
#include "skype_proto.h"
-#include "requests/login.h"
-#include "requests/profile.h"
+
+#include "requests/avatars.h"
+#include "requests/capabilities.h"
+#include "requests/chatrooms.h"
#include "requests/contacts.h"
-#include "requests/status.h"
#include "requests/endpoint.h"
-#include "requests/capabilities.h"
-#include "requests/subscriptions.h"
-#include "requests/messages.h"
+#include "requests/files.h"
#include "requests/history.h"
+#include "requests/login.h"
+#include "requests/messages.h"
+#include "requests/mslogin.h"
+#include "requests/oauth.h"
#include "requests/poll.h"
-#include "requests/avatars.h"
+#include "requests/profile.h"
#include "requests/search.h"
-#include "requests/chatrooms.h"
+#include "requests/status.h"
+#include "requests/subscriptions.h"
#include "requests/trouter.h"
-#include "requests/mslogin.h"
-#include "requests/oauth.h"
-#include "requests/asm/files.h"
#include "request_queue.h"
void SkypeHttpResponse(const NETLIBHTTPREQUEST *response, void *arg);
|