Transmit mediaType, preparation for header image

This commit is contained in:
Michael 2021-06-22 03:17:41 +00:00
parent 47cb89967f
commit dd39b3203b

View file

@ -379,8 +379,19 @@ class Transmitter
'owner' => $contact['url'],
'publicKeyPem' => $user['pubkey']];
$data['endpoints'] = ['sharedInbox' => DI::baseUrl() . '/inbox'];
$data['icon'] = ['type' => 'Image',
'url' => $contact['photo']];
$data['icon'] = ['type' => 'Image', 'url' => $contact['photo']];
$resourceid = Photo::ridFromURI($contact['photo']);
if (!empty($resourceid)) {
$photo = Photo::selectFirst(['type'], ["resource-id" => $resourceid]);
if (!empty($photo['type'])) {
$data['icon']['mediaType'] = $photo['type'];
}
}
if (!empty($contact['header'])) {
$data['image'] = ['type' => 'Image', 'url' => $contact['header']];
}
$data['generator'] = self::getService();