Skip to content

Commit

Permalink
Merge pull request #7456 from nextcloud/12_7342
Browse files Browse the repository at this point in the history
[stable12] CardDAV convertor check should not be to wide
  • Loading branch information
MorrisJobke authored Dec 12, 2017
2 parents 4b60ada + dfed58e commit f44d5bd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/dav/lib/CardDAV/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,19 @@ public function createCardFromUser(IUser $user) {

$publish = false;

if ($image !== null && isset($userData[AccountManager::PROPERTY_AVATAR])) {
$userData[AccountManager::PROPERTY_AVATAR]['value'] = true;
}

foreach ($userData as $property => $value) {

$shareWithTrustedServers =
$value['scope'] === AccountManager::VISIBILITY_CONTACTS_ONLY ||
$value['scope'] === AccountManager::VISIBILITY_PUBLIC;

$emptyValue = !isset($value['value']) || $value['value'] === '';
$noImage = $image === null;

if ($shareWithTrustedServers && (!$emptyValue || !$noImage)) {
if ($shareWithTrustedServers && !$emptyValue) {
$publish = true;
switch ($property) {
case AccountManager::PROPERTY_DISPLAYNAME:
Expand Down

0 comments on commit f44d5bd

Please sign in to comment.