diff options
Diffstat (limited to 'backends/cloud/onedrive/onedrivestorage.cpp')
-rw-r--r-- | backends/cloud/onedrive/onedrivestorage.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp index 1008cab31f..458aaecf88 100644 --- a/backends/cloud/onedrive/onedrivestorage.cpp +++ b/backends/cloud/onedrive/onedrivestorage.cpp @@ -30,10 +30,14 @@ #include "backends/networking/curl/connectionmanager.h" #include "backends/networking/curl/curljsonrequest.h" #include "backends/networking/curl/networkreadstream.h" +#include "common/config-manager.h" #include "common/debug.h" #include "common/json.h" #include <curl/curl.h> -#include "common/config-manager.h" + +#ifdef ENABLE_RELEASE +#include "dists/clouds/cloud_keys.h" +#endif namespace Cloud { namespace OneDrive { @@ -46,6 +50,10 @@ char *OneDriveStorage::KEY = nullptr; //can't use CloudConfig there yet, loading char *OneDriveStorage::SECRET = nullptr; //TODO: hide these secrets somehow void OneDriveStorage::loadKeyAndSecret() { +#ifdef ENABLE_RELEASE + KEY = RELEASE_ONEDRIVE_KEY; + SECRET = RELEASE_ONEDRIVE_SECRET; +#else Common::String k = ConfMan.get("ONEDRIVE_KEY", ConfMan.kCloudDomain); KEY = new char[k.size() + 1]; memcpy(KEY, k.c_str(), k.size()); @@ -55,6 +63,7 @@ void OneDriveStorage::loadKeyAndSecret() { SECRET = new char[k.size() + 1]; memcpy(SECRET, k.c_str(), k.size()); SECRET[k.size()] = 0; +#endif } OneDriveStorage::OneDriveStorage(Common::String accessToken, Common::String userId, Common::String refreshToken): |