Przeglądaj źródła

Update custom emoji json-ld

Daniel Supernault 3 lat temu
rodzic
commit
46d5f12590

+ 1 - 1
app/Models/CustomEmoji.php

@@ -31,7 +31,7 @@ class CustomEmoji extends Model
 				$url = url('/storage/' . $tag->media_path);
 
 				if($activitypub == true) {
-					$mediaType = Str::endsWith($url, '.png') ? 'image/png' : 'image/jpeg';
+					$mediaType = Str::endsWith($url, '.png') ? 'image/png' : 'image/jpg';
 					return [
 						'id' => url('emojis/' . $tag->id),
 						'type' => 'Emoji',

+ 3 - 1
app/Transformer/ActivityPub/Verb/CreateNote.php

@@ -64,7 +64,9 @@ class CreateNote extends Fractal\TransformerAbstract
 						'announce'		=> ['@type' => '@id'],
 						'like'			=> ['@type' => '@id'],
 						'reply'			=> ['@type' => '@id']
-					]
+					],
+					'toot' 				=> 'http://joinmastodon.org/ns#',
+					'Emoji'				=> 'toot:Emoji'
 				]
 			],
 			'id' 					=> $status->permalink(),

+ 3 - 1
app/Transformer/ActivityPub/Verb/Note.php

@@ -65,7 +65,9 @@ class Note extends Fractal\TransformerAbstract
 						'announce'		=> ['@type' => '@id'],
 						'like'			=> ['@type' => '@id'],
 						'reply'			=> ['@type' => '@id'],
-					]
+					],
+					'toot' 				=> 'http://joinmastodon.org/ns#',
+					'Emoji'				=> 'toot:Emoji'
 				]
 			],
 			'id' 				=> $status->url(),