Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/notifications.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-10-27 10:44:11 +0300
committerJoas Schilling <coding@schilljs.com>2021-10-27 10:44:11 +0300
commit80dd70d853ff8a3c19891afc48e5d041ccb12d84 (patch)
tree7df3834e2a42fb233c64c1592dcbec7117de4ad0 /lib
parent298c227f5265a5ee8c50369fc4c2724e6f35b42c (diff)
Improve feedback in test-push when device is too old
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Push.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Push.php b/lib/Push.php
index 1405297..8df6c04 100644
--- a/lib/Push.php
+++ b/lib/Push.php
@@ -170,7 +170,7 @@ class Push {
if (isset($userStatus[$notification->getUser()])) {
$userStatus = $userStatus[$notification->getUser()];
if ($userStatus->getStatus() === IUserStatus::DND) {
- $this->printInfo('User status is set to DND');
+ $this->printInfo('<error>User status is set to DND - no push notifications will be sent</error>');
return;
}
}
@@ -390,6 +390,11 @@ class Push {
// Check if the token is still valid...
$token = $this->tokenProvider->getTokenById($tokenId);
$this->cache->set('t' . $tokenId, $token->getLastCheck(), 600);
+ if ($token->getLastCheck() > $maxAge) {
+ $this->printInfo('Device token is valid');
+ } else {
+ $this->printInfo('Device token "last checked" is older than 60 days: ' . $token->getLastCheck());
+ }
return $token->getLastCheck() > $maxAge;
} catch (InvalidTokenException $e) {
// Token does not exist anymore, should drop the push device entry