diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2021-11-01 14:05:57 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-01 14:05:57 +0300 |
commit | 474ff4163114c891b6f58086d33eacb3e8136096 (patch) | |
tree | 273d232dad63b717c21cdf7d1372ff6cbfc85b80 /lib | |
parent | f1c01e3401208950f19ab78488f145b425e15c42 (diff) | |
parent | 80dd70d853ff8a3c19891afc48e5d041ccb12d84 (diff) |
Merge pull request #1101 from nextcloud/bugfix/noid/improve-feedback-when-device-is-too-old
Improve feedback in test-push when device is too old
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Push.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Push.php b/lib/Push.php index 1bf2e0f..b4770c6 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; } } @@ -389,6 +389,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 |