Merge pull request #5855 from annando/ap-avatar

AP: Avoid an empty avatar field
This commit is contained in:
Hypolite Petovan 2018-10-08 00:06:41 -04:00 committed by GitHub
commit 4472cf2289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -209,12 +209,17 @@ class Transmitter
return [];
}
$fields = ['name', 'url', 'location', 'about', 'avatar'];
$fields = ['name', 'url', 'location', 'about', 'avatar', 'photo'];
$contact = DBA::selectFirst('contact', $fields, ['uid' => $uid, 'self' => true]);
if (!DBA::isResult($contact)) {
return [];
}
// On old installations and never changed contacts this might not be filled
if (empty($contact['avatar'])) {
$contact['avatar'] = $contact['photo'];
}
$data = ['@context' => ActivityPub::CONTEXT];
$data['id'] = $contact['url'];
$data['diaspora:guid'] = $user['guid'];