Transmit mediaType for headers as well / use blank image for empty header

This commit is contained in:
Michael 2021-06-22 13:58:29 +00:00
parent dd39b3203b
commit df05d6b52a
2 changed files with 10 additions and 1 deletions

View file

@ -391,6 +391,14 @@ class Transmitter
if (!empty($contact['header'])) {
$data['image'] = ['type' => 'Image', 'url' => $contact['header']];
$resourceid = Photo::ridFromURI($contact['header']);
if (!empty($resourceid)) {
$photo = Photo::selectFirst(['type'], ["resource-id" => $resourceid]);
if (!empty($photo['type'])) {
$data['image']['mediaType'] = $photo['type'];
}
}
}
$data['generator'] = self::getService();