From d77ba193083f8cc0dbc7ebaa638cc13a7272fbc2 Mon Sep 17 00:00:00 2001
From: Lim Chee Aun <cheeaun@gmail.com>
Date: Wed, 3 Apr 2024 17:58:37 +0800
Subject: [PATCH] Handle another kind of emojiReaction response

Can't everyone just standardize the responses?
---
 src/components/status.jsx | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/components/status.jsx b/src/components/status.jsx
index 6ce567c4..2d739824 100644
--- a/src/components/status.jsx
+++ b/src/components/status.jsx
@@ -1943,7 +1943,24 @@ function Status({
               {!!emojiReactions?.length && (
                 <div class="emoji-reactions">
                   {emojiReactions.map((emojiReaction) => {
-                    const { name, count, me } = emojiReaction;
+                    const { name, count, me, url, staticUrl } = emojiReaction;
+                    if (url) {
+                      // Some servers return url and staticUrl
+                      return (
+                        <span
+                          class={`emoji-reaction tag ${
+                            me ? '' : 'insignificant'
+                          }`}
+                        >
+                          <CustomEmoji
+                            alt={name}
+                            url={url}
+                            staticUrl={staticUrl}
+                          />{' '}
+                          {count}
+                        </span>
+                      );
+                    }
                     const isShortCode = /^:.+?:$/.test(name);
                     if (isShortCode) {
                       const emoji = emojis.find(
@@ -1962,7 +1979,7 @@ function Status({
                               alt={name}
                               url={emoji.url}
                               staticUrl={emoji.staticUrl}
-                            />
+                            />{' '}
                             {count}
                           </span>
                         );