]> git.mxchange.org Git - friendica.git/commitdiff
Extract emojis into mastodon api only for local posts
authorgudzpoz <gudzpoz@live.com>
Sun, 12 Nov 2023 14:17:37 +0000 (22:17 +0800)
committergudzpoz <gudzpoz@live.com>
Sun, 12 Nov 2023 14:17:37 +0000 (22:17 +0800)
src/Factory/Api/Mastodon/Status.php

index aaaa8d3d94bb95149bc828209c32f32e92fa7571..4cdc8a78fc43c72701cee8d3f25759bcae1dd620 100644 (file)
@@ -288,8 +288,11 @@ class Status extends BaseFactory
                        }
                }
 
-               $used_smilies = Smilies::extractUsedSmilies($item['body'] ?: $item['raw-body']);
-               $emojis = $this->mstdnEmojiFactory->createCollectionFromArray($used_smilies)->getArrayCopy(true);
+               $emojis = null;
+               if (DI::baseUrl()->isLocalUrl($item['uri'])) {
+                       $used_smilies = Smilies::extractUsedSmilies($item['body'] ?: $item['raw-body']);
+                       $emojis = $this->mstdnEmojiFactory->createCollectionFromArray($used_smilies)->getArrayCopy(true);
+               }
 
                if ($is_reshare) {
                        try {