From 917b801eb68eb3d382bb3752e117b57dbe07d034 Mon Sep 17 00:00:00 2001 From: gudzpoz Date: Sun, 12 Nov 2023 22:17:37 +0800 Subject: [PATCH] Extract emojis into mastodon api only for local posts --- src/Factory/Api/Mastodon/Status.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index aaaa8d3d94..4cdc8a78fc 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -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 { -- 2.39.5