From 4c39933e8deeead5c29e3b776c187889496dd699 Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 14 Nov 2024 03:48:48 +0000 Subject: [PATCH] Fixed emotes not displaying on insecure connections and use new API endpoint. --- public/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/index.php b/public/index.php index e17734b..6eab68a 100644 --- a/public/index.php +++ b/public/index.php @@ -129,12 +129,12 @@ if(!empty($_GET['common'])) { if(isset($soundInfo->sources->mp3)) $config['soundFiles'][strtr($soundInfo->name, [':' => '_', '-' => '_'])] = $soundInfo->sources->mp3; - $emotesUrl = 'https:' . $common->emotes; + $emotesUrl = 'https:' . $common->api . '/v1/emotes'; $emotes = json_decode(file_get_contents($emotesUrl)); foreach($emotes as $emoteInfo) - if($emoteInfo->Hierarchy < 1) { - $config['emoticonCodes'][] = $emoteInfo->Text[0]; - $config['emoticonFiles'][] = $emoteInfo->Image; + if(empty($emoteInfo->min_rank)) { + $config['emoticonCodes'][] = sprintf(':%s:', $emoteInfo->strings[0]); + $config['emoticonFiles'][] = str_starts_with($emoteInfo->url, 'https:') ? substr($emoteInfo->url, 6) : $emoteInfo->url; } header('Content-Type: application/javascript; charset=utf-8');