diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-11-13 18:27:42 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-11-13 18:27:42 +0000 |
commit | 174c71beee3a68982cea9244423f117e0af375a5 (patch) | |
tree | 836e92d50e67886f9acf72a4e77a65f0156226fc /protocols/SkypeWeb/src/requests | |
parent | 85c9a8f36922b56fcf9b42842dfe37902b028ce0 (diff) |
oops
git-svn-id: http://svn.miranda-ng.org/main/trunk@15719 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/requests')
-rw-r--r-- | protocols/SkypeWeb/src/requests/asm/images.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/requests/asm/images.h b/protocols/SkypeWeb/src/requests/asm/images.h new file mode 100644 index 0000000000..853bbf2dc0 --- /dev/null +++ b/protocols/SkypeWeb/src/requests/asm/images.h @@ -0,0 +1,43 @@ +#pragma once
+
+class ASMObjectCreateRequest : public HttpRequest
+{
+public:
+ ASMObjectCreateRequest(LoginInfo &li, const char *szContact) :
+ HttpRequest(REQUEST_POST, "api.asm.skype.com/v1/objects")
+ {
+ Headers
+ << CHAR_VALUE("Authorization:", CMStringA(::FORMAT, "skype_token %s", li.api.szToken));
+
+ JSONNode node, jPermissions, jPermission(JSON_ARRAY);
+ jPermissions.set_name("permissions");
+ jPermission.set_name(CMStringA(::FORMAT, "8:%s", szContact).GetString());
+ jPermission << JSONNode("read", (char*)NULL);
+ jPermissions << jPermission;
+ node << JSONNode("type", "pish/image") << jPermissions;
+
+ Body << VALUE(node.write().c_str());
+
+ }// {"id":"0-neu-d1-d0649c1fb4e4c60f2d2d1f2165a99f60"}
+};
+
+class ASMObjectUploadRequest : public HttpRequest
+{
+public:
+ ASMObjectUploadRequest(LoginInfo &li, const char *szObject, const PBYTE data, const size_t size) :
+ HttpRequest(REQUEST_POST, FORMAT, "api.asm.skype.com/v1/objects/%s/content/imgpsh", szObject)
+ {
+ Headers
+ << CHAR_VALUE("Authorization:", CMStringA(::FORMAT, "skype_token %s", li.api.szToken));
+
+ pData = (char*)mir_alloc(size);
+ memcpy(pData, data, size);
+ dataLength = (int)size;
+
+ }
+ ~ASMObjectUploadRequest()
+ {
+ mir_free(pData);
+ HttpRequest::~HttpRequest();
+ }
+};
\ No newline at end of file |