From 65bcf548620243d6d8fda16665b3713572c9214c Mon Sep 17 00:00:00 2001 From: Alexey Shpakovsky Date: Sat, 29 May 2021 16:09:01 +0200 Subject: [PATCH] remove synchronisation - it seems we're fine without it, too --- abook_class.php | 31 ------------------------------- 1 file changed, 31 deletions(-) mode change 100644 => 100755 abook_class.php diff --git a/abook_class.php b/abook_class.php old mode 100644 new mode 100755 index fa80154..13a3ea1 --- a/abook_class.php +++ b/abook_class.php @@ -20,26 +20,6 @@ use MStilkerich\CardDavClient\Services\{Discovery, Sync, SyncHandler}; use Psr\Log\{AbstractLogger, NullLogger, LogLevel}; use Sabre\VObject\Component\VCard; -class NullSyncHandler implements SyncHandler -{ - public function addressObjectChanged(string $uri, string $etag, ?VCard $card): void - { - } - - public function addressObjectDeleted(string $uri): void - { - } - - public function getExistingVCardETags(): array - { - return []; - } - - public function finalizeSync(): void - { - } -} - Config::init(); /** @@ -92,16 +72,7 @@ class abook_carddav extends addressbook_backend { if (count($abooks) <= 0) { return $this->set_error("Cannot proceed because no addressbooks were found - exiting"); } - ////////////////////////////////////////////////////////// - // THE FOLLOWING SHOWS HOW TO PERFORM A SYNCHRONIZATION // - ////////////////////////////////////////////////////////// $this->abook = $abooks[0]; - $this->synchandler = new NullSyncHandler(); - $this->syncmgr = new Sync(); - - // initial sync - we don't have a sync-token yet - $this->lastSyncToken = $this->syncmgr->synchronize($this->abook, $this->synchandler, ["FN", "N", "EMAIL", "ORG"], ""); - return true; } @@ -217,8 +188,6 @@ class abook_carddav extends addressbook_backend { // insert address function $this->abook->createCard($vcard); - // now a sync should return that card as well - lets see! - $this->lastSyncToken = $this->syncmgr->synchronize($this->abook, $this->synchandler, ["FN", "N", "EMAIL", "ORG"], $this->lastSyncToken); // return true if operation is succesful. return true;