diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-03-07 19:41:15 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-03-07 19:41:15 +0000 |
commit | 3997c1912c9ef57697452f357b02b10b8f5bc6a7 (patch) | |
tree | 06003caf27213aa4bd5ecaf36992b03037c7b1b3 /plugins/Dropbox/src/dropbox_utils.cpp | |
parent | 370996a4a7ced75fe363bc1c3eb34f77f5d7aee1 (diff) |
Dropbox:
- code cleaning and reorganization
- added "/help" command
- more informative authorization request
- version bumped
git-svn-id: http://svn.miranda-ng.org/main/trunk@8456 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_utils.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_utils.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp index 43bef5ca61..e3a05093df 100644 --- a/plugins/Dropbox/src/dropbox_utils.cpp +++ b/plugins/Dropbox/src/dropbox_utils.cpp @@ -1,26 +1,34 @@ #include "common.h"
+HANDLE CDropbox::CreateProtoServiceFunctionObj(const char *szService, MIRANDASERVICEOBJ serviceProc, void *obj)
+{
+ char str[MAXMODULELABELLENGTH];
+ mir_snprintf(str, sizeof(str), "%s%s", MODULE, szService);
+ str[MAXMODULELABELLENGTH - 1] = 0;
+ return CreateServiceFunctionObj(str, serviceProc, obj);
+}
+
wchar_t *CDropbox::HttpStatusToText(HTTP_STATUS status)
{
switch (status)
{
- case OK:
- return TranslateT("OK");
- case BAD_REQUEST:
+ case HTTP_STATUS_OK:
+ return TranslateT("Ok");
+ case HTTP_STATUS_BAD_REQUEST:
return TranslateT("Bad input parameter. Error message should indicate which one and why");
- case UNAUTHORIZED:
+ case HTTP_STATUS_UNAUTHORIZED:
return TranslateT("Bad or expired token. This can happen if the user or Dropbox revoked or expired an access token. To fix, you should re-authenticate the user");
- case FORBIDDEN:
+ case HTTP_STATUS_FORBIDDEN:
return TranslateT("Bad OAuth request (wrong consumer key, bad nonce, expired timestamp...). Unfortunately, re-authenticating the user won't help here");
- case NOT_FOUND:
+ case HTTP_STATUS_NOT_FOUND:
return TranslateT("File or folder not found at the specified path");
- case METHOD_NOT_ALLOWED:
+ case HTTP_STATUS_METHOD_NOT_ALLOWED:
return TranslateT("Request method not expected (generally should be GET or POST)");
- case TOO_MANY_REQUESTS:
+ case HTTP_STATUS_TOO_MANY_REQUESTS:
return TranslateT("Your app is making too many requests and is being rate limited. 429s can trigger on a per-app or per-user basis");
- case SERVICE_UNAVAILABLE:
+ case HTTP_STATUS_SERVICE_UNAVAILABLE:
return TranslateT("If the response includes the Retry-After header, this means your OAuth 1.0 app is being rate limited. Otherwise, this indicates a transient server error, and your app should retry its request.");
- case INSUFICIENTE_STORAGE:
+ case HTTP_STATUS_INSUFICIENTE_STORAGE:
return TranslateT("User is over Dropbox storage quota");
}
|