]> git.mxchange.org Git - friendica.git/commitdiff
Transmit mediaType, preparation for header image
authorMichael <heluecht@pirati.ca>
Tue, 22 Jun 2021 03:17:41 +0000 (03:17 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 22 Jun 2021 03:17:41 +0000 (03:17 +0000)
src/Protocol/ActivityPub/Transmitter.php

index 8bfc00a8626504b27a96996cf7459f32f5fce2e0..17fd1b1502ee06d0c5ae2011e54e36df799d6d4d 100644 (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();