use uri substring as nickname

This commit is contained in:
Alexey Shpakovsky 2021-05-29 16:08:39 +02:00
parent 21560647b7
commit 67ee13d910
1 changed files with 3 additions and 1 deletions

4
abook_class.php Executable file → Normal file
View File

@ -169,12 +169,14 @@ class abook_carddav extends addressbook_backend {
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)
*/
$abook_uri_len=strlen($this->abook->getUriPath());
foreach($all as $uri => $one) {
$vcard = $one['vcard'];
$names = $vcard->N->getParts();
// last,first,additional,prefix,suffix
array_push($ret,array(
'nickname' => $uri,
'nickname' => substr($uri, $abook_uri_len),
'name' => (string)$vcard->FN,
'firstname' => (string)$names[1],
'lastname' => (string)$names[0],