fix listing

This commit is contained in:
Alexey Shpakovsky 2021-05-30 17:14:50 +02:00
parent da870a6d11
commit 7c14888987
No known key found for this signature in database
GPG key ID: 5797A726A2A4230A

View file

@ -115,11 +115,11 @@ class abook_carddav extends addressbook_backend {
if(!isset($vcard->EMAIL)) { continue; } if(!isset($vcard->EMAIL)) { continue; }
if($this->writeable) { if($this->writeable) {
// all one line per each vcard // all one line per each vcard
$ret[] = $this.vcard2sq($uri, $vcard); $ret[] = $this->vcard2sq($uri, $vcard);
} else { } else {
foreach($vcard->EMAIL as $email) { foreach($vcard->EMAIL as $email) {
// all one line per each email // all one line per each email
$ret[] = $this.vcard2sq($uri, $vcard, $email); $ret[] = $this->vcard2sq($uri, $vcard, $email);
} }
} }
if($limit == 1) { return $ret[0]; } if($limit == 1) { return $ret[0]; }
@ -181,7 +181,7 @@ class abook_carddav extends addressbook_backend {
vcard(VCard): VCard as Sabre/VObject VCard vcard(VCard): VCard as Sabre/VObject VCard
*/ */
$vcard = $one['vcard']; $vcard = $one['vcard'];
return vcard2sq($uri, $vcard); return $this->vcard2sq($uri, $vcard);
} }
if($field == SM_ABOOK_FIELD_FIRSTNAME) { if($field == SM_ABOOK_FIELD_FIRSTNAME) {
// TODO: this will be harder // TODO: this will be harder
@ -205,6 +205,7 @@ class abook_carddav extends addressbook_backend {
* @return array of addresses (arrays) * @return array of addresses (arrays)
*/ */
function list_addr() { function list_addr() {
if(!$this->listing) { return array(); }
// list all addresses having an email // list all addresses having an email
return $this->run_query(['EMAIL' => "//"]); return $this->run_query(['EMAIL' => "//"]);
} }