summaryrefslogtreecommitdiffstats
path: root/apps/federation/lib/syncfederationaddressbooks.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/federation/lib/syncfederationaddressbooks.php')
-rw-r--r--apps/federation/lib/syncfederationaddressbooks.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/federation/lib/syncfederationaddressbooks.php b/apps/federation/lib/syncfederationaddressbooks.php
index 886f6505b20..f9cee9a7137 100644
--- a/apps/federation/lib/syncfederationaddressbooks.php
+++ b/apps/federation/lib/syncfederationaddressbooks.php
@@ -3,6 +3,7 @@
namespace OCA\Federation;
use OCA\DAV\CardDAV\SyncService;
+use OCP\AppFramework\Http;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Input\InputInterface;
@@ -51,6 +52,9 @@ class SyncFederationAddressBooks {
$this->dbHandler->setServerStatus($url, TrustedServers::STATUS_OK, $newToken);
}
} catch (\Exception $ex) {
+ if ($ex->getCode() === Http::STATUS_UNAUTHORIZED) {
+ $this->dbHandler->setServerStatus($url, TrustedServers::STATUS_ACCESS_REVOKED);
+ }
$callback($url, $ex);
}
}