summaryrefslogtreecommitdiff
path: root/plugins/Dropbox/src/dropbox_utils.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-02-24 17:38:35 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-02-24 17:38:35 +0000
commite62bc2a6f28f6a7b7fcb3996e9fab86fae3239f7 (patch)
tree6fc970809eb2fbbbf383c1639f83c93a2edf406b /plugins/Dropbox/src/dropbox_utils.cpp
parent994443d6cdca5a5a1204575a0cea2a198c9d01bb (diff)
Dropbox:
- added ability to send files to contacts of other protocols - many other little improvements git-svn-id: http://svn.miranda-ng.org/main/trunk@8263 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_utils.cpp')
-rw-r--r--plugins/Dropbox/src/dropbox_utils.cpp31
1 files changed, 29 insertions, 2 deletions
diff --git a/plugins/Dropbox/src/dropbox_utils.cpp b/plugins/Dropbox/src/dropbox_utils.cpp
index eaed860e19..cba5442ba9 100644
--- a/plugins/Dropbox/src/dropbox_utils.cpp
+++ b/plugins/Dropbox/src/dropbox_utils.cpp
@@ -1,5 +1,32 @@
#include "common.h"
+wchar_t *CDropbox::HttpStatusToText(HTTP_STATUS status)
+{
+ switch (status)
+ {
+ case OK:
+ return TranslateT("Ok");
+ case BAD_REQUEST:
+ return TranslateT("Bad input parameter. Error message should indicate which one and why");
+ case 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:
+ return TranslateT("Bad OAuth request (wrong consumer key, bad nonce, expired timestamp...). Unfortunately, re-authenticating the user won't help here");
+ case NOT_FOUND:
+ return TranslateT("File or folder not found at the specified path");
+ case METHOD_NOT_ALLOWED:
+ return TranslateT("Request method not expected (generally should be GET or POST)");
+ case 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:
+ 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:
+ return TranslateT("User is over Dropbox storage quota");
+ }
+
+ return TranslateT("Unknown");
+}
+
void CDropbox::ShowNotification(const wchar_t *caption, const wchar_t *message, int flags, MCONTACT hContact)
{
if (Miranda_Terminated()) return;
@@ -14,9 +41,9 @@ void CDropbox::ShowNotification(const wchar_t *caption, const wchar_t *message,
if (!PUAddPopupW(&ppd))
return;
-
+
}
-
+
MessageBox(NULL, message, caption, MB_OK | flags);
}