From 12b495e341e4d4c573f1d53bd12f2845aa68d805 Mon Sep 17 00:00:00 2001 From: Alexey Shpakovsky Date: Sat, 29 May 2021 00:35:01 +0200 Subject: [PATCH] Revert "use UID for nicks, also mark addressbook as writeable" This reverts commit 63d1116b5e1958e8f6a195ac9e40352fb52f277a. --- abook_class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/abook_class.php b/abook_class.php index 9d76bca..8ecfcd8 100755 --- a/abook_class.php +++ b/abook_class.php @@ -48,7 +48,7 @@ Config::init(); class abook_carddav extends addressbook_backend { var $btype = 'local'; var $bname = 'carddav'; - var $writeable = true; + var $writeable = false; /* ========================== Private ======================= */ @@ -100,7 +100,7 @@ class abook_carddav extends addressbook_backend { $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", "UID"], ""); + $this->lastSyncToken = $this->syncmgr->synchronize($this->abook, $this->synchandler, ["FN", "N", "EMAIL", "ORG"], ""); return true; } @@ -163,18 +163,19 @@ class abook_carddav extends addressbook_backend { $ret = array(); // list all addresses having an email - $all=$this->abook->query(['EMAIL' => "//"],["FN", "N", "EMAIL", "ORG", "UID"]); + $all=$this->abook->query(['EMAIL' => "//"],["FN", "N", "EMAIL", "ORG"]); /* Returns an array of matched VCards: The keys of the array are the URIs of the vcards The values are associative arrays with keys etag (type: string) and vcard (type: VCard) */ + $id=1; foreach($all as $uri => $one) { $vcard = $one['vcard']; $names = $vcard->N->getParts(); // last,first,additional,prefix,suffix array_push($ret,array( - 'nickname' => (string)$vcard->UID, + 'nickname' => 'id'.$id++, 'name' => (string)$vcard->FN, 'firstname' => (string)$names[1], 'lastname' => (string)$names[0],