Fixed emotes not displaying on insecure connections and use new API endpoint.

This commit is contained in:
flash 2024-11-14 03:48:48 +00:00
parent 359303e515
commit 4c39933e8d

View file

@ -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');