summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/Services
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CloudFile/src/Services')
-rw-r--r--plugins/CloudFile/src/Services/dropbox_service.cpp4
-rw-r--r--plugins/CloudFile/src/Services/google_service.cpp8
-rw-r--r--plugins/CloudFile/src/Services/microsoft_service.cpp8
-rw-r--r--plugins/CloudFile/src/Services/yandex_service.cpp8
4 files changed, 14 insertions, 14 deletions
diff --git a/plugins/CloudFile/src/Services/dropbox_service.cpp b/plugins/CloudFile/src/Services/dropbox_service.cpp
index 2bdb577c19..f1157a52b2 100644
--- a/plugins/CloudFile/src/Services/dropbox_service.cpp
+++ b/plugins/CloudFile/src/Services/dropbox_service.cpp
@@ -53,7 +53,7 @@ unsigned CDropboxService::RequestAccessTokenThread(void *owner, void *param)
DropboxAPI::GetAccessTokenRequest request(requestToken);
NLHR_PTR response(request.Send(service->hConnection));
- if (response == NULL || response->resultCode != HTTP_CODE_OK) {
+ if (response == nullptr || response->resultCode != HTTP_CODE_OK) {
Netlib_Logf(service->hConnection, "%s: %s", service->GetModule(), service->HttpStatusToError());
//ShowNotification(TranslateT("server does not respond"), MB_ICONERROR);
return 0;
@@ -171,7 +171,7 @@ void CDropboxService::CreateSharedLink(const char *path, char *url)
DropboxAPI::CreateSharedLinkRequest shareRequest(token, path);
NLHR_PTR response(shareRequest.Send(hConnection));
- if (response == NULL)
+ if (response == nullptr)
throw Exception(HttpStatusToError());
if (!HTTP_CODE_SUCCESS(response->resultCode) &&
diff --git a/plugins/CloudFile/src/Services/google_service.cpp b/plugins/CloudFile/src/Services/google_service.cpp
index 0f5e2c793d..5c5b7703d4 100644
--- a/plugins/CloudFile/src/Services/google_service.cpp
+++ b/plugins/CloudFile/src/Services/google_service.cpp
@@ -26,7 +26,7 @@ bool CGDriveService::IsLoggedIn()
ptrA token(db_get_sa(NULL, GetModule(), "TokenSecret"));
if (!token || token[0] == 0)
return false;
- time_t now = time(NULL);
+ time_t now = time(nullptr);
time_t expiresIn = db_get_dw(NULL, GetModule(), "ExpiresIn");
return now < expiresIn;
}
@@ -45,7 +45,7 @@ void CGDriveService::Login()
db_set_s(NULL, GetModule(), "TokenSecret", node.as_string().c_str());
node = root.at("expires_in");
- time_t expiresIn = time(NULL) + node.as_int();
+ time_t expiresIn = time(nullptr) + node.as_int();
db_set_dw(NULL, GetModule(), "ExpiresIn", expiresIn);
return;
@@ -74,7 +74,7 @@ unsigned CGDriveService::RequestAccessTokenThread(void *owner, void *param)
GDriveAPI::GetAccessTokenRequest request(requestToken);
NLHR_PTR response(request.Send(service->hConnection));
- if (response == NULL || response->resultCode != HTTP_CODE_OK) {
+ if (response == nullptr || response->resultCode != HTTP_CODE_OK) {
const char *error = response->dataLength
? response->pData
: service->HttpStatusToError(response->resultCode);
@@ -103,7 +103,7 @@ unsigned CGDriveService::RequestAccessTokenThread(void *owner, void *param)
db_set_s(NULL, service->GetModule(), "TokenSecret", node.as_string().c_str());
node = root.at("expires_in");
- time_t expiresIn = time(NULL) + node.as_int();
+ time_t expiresIn = time(nullptr) + node.as_int();
db_set_dw(NULL, service->GetModule(), "ExpiresIn", expiresIn);
node = root.at("refresh_token");
diff --git a/plugins/CloudFile/src/Services/microsoft_service.cpp b/plugins/CloudFile/src/Services/microsoft_service.cpp
index 9f0cb30c7b..38519e6d55 100644
--- a/plugins/CloudFile/src/Services/microsoft_service.cpp
+++ b/plugins/CloudFile/src/Services/microsoft_service.cpp
@@ -26,7 +26,7 @@ bool COneDriveService::IsLoggedIn()
ptrA token(db_get_sa(NULL, GetModule(), "TokenSecret"));
if (!token || token[0] == 0)
return false;
- time_t now = time(NULL);
+ time_t now = time(nullptr);
time_t expiresIn = db_get_dw(NULL, GetModule(), "ExpiresIn");
return now < expiresIn;
}
@@ -45,7 +45,7 @@ void COneDriveService::Login()
db_set_s(NULL, GetModule(), "TokenSecret", node.as_string().c_str());
node = root.at("expires_in");
- time_t expiresIn = time(NULL) + node.as_int();
+ time_t expiresIn = time(nullptr) + node.as_int();
db_set_dw(NULL, GetModule(), "ExpiresIn", expiresIn);
return;
@@ -76,7 +76,7 @@ unsigned COneDriveService::RequestAccessTokenThread(void *owner, void *param)
OneDriveAPI::GetAccessTokenRequest request(requestToken);
NLHR_PTR response(request.Send(service->hConnection));
- if (response == NULL || response->resultCode != HTTP_CODE_OK) {
+ if (response == nullptr || response->resultCode != HTTP_CODE_OK) {
const char *error = response->dataLength
? response->pData
: service->HttpStatusToError(response->resultCode);
@@ -105,7 +105,7 @@ unsigned COneDriveService::RequestAccessTokenThread(void *owner, void *param)
db_set_s(NULL, service->GetModule(), "TokenSecret", node.as_string().c_str());
node = root.at("expires_in");
- time_t expiresIn = time(NULL) + node.as_int();
+ time_t expiresIn = time(nullptr) + node.as_int();
db_set_dw(NULL, service->GetModule(), "ExpiresIn", expiresIn);
node = root.at("refresh_token");
diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp
index d012dd3cc8..1e4d5749cb 100644
--- a/plugins/CloudFile/src/Services/yandex_service.cpp
+++ b/plugins/CloudFile/src/Services/yandex_service.cpp
@@ -26,7 +26,7 @@ bool CYandexService::IsLoggedIn()
ptrA token(db_get_sa(NULL, GetModule(), "TokenSecret"));
if (!token || token[0] == 0)
return false;
- time_t now = time(NULL);
+ time_t now = time(nullptr);
time_t expiresIn = db_get_dw(NULL, GetModule(), "ExpiresIn");
return now < expiresIn;
}
@@ -45,7 +45,7 @@ void CYandexService::Login()
db_set_s(NULL, GetModule(), "TokenSecret", node.as_string().c_str());
node = root.at("expires_in");
- time_t expiresIn = time(NULL) + node.as_int();
+ time_t expiresIn = time(nullptr) + node.as_int();
db_set_dw(NULL, GetModule(), "ExpiresIn", expiresIn);
node = root.at("refresh_token");
@@ -77,7 +77,7 @@ unsigned CYandexService::RequestAccessTokenThread(void *owner, void *param)
YandexAPI::GetAccessTokenRequest request(requestToken);
NLHR_PTR response(request.Send(service->hConnection));
- if (response == NULL || response->resultCode != HTTP_CODE_OK) {
+ if (response == nullptr || response->resultCode != HTTP_CODE_OK) {
const char *error = response->dataLength
? response->pData
: service->HttpStatusToError(response->resultCode);
@@ -106,7 +106,7 @@ unsigned CYandexService::RequestAccessTokenThread(void *owner, void *param)
db_set_s(NULL, service->GetModule(), "TokenSecret", node.as_string().c_str());
node = root.at("expires_in");
- time_t expiresIn = time(NULL) + node.as_int();
+ time_t expiresIn = time(nullptr) + node.as_int();
db_set_dw(NULL, service->GetModule(), "ExpiresIn", expiresIn);
node = root.at("refresh_token");