Fixed emoticons not loading.

This commit is contained in:
flash 2025-04-25 17:08:04 +00:00
parent 3909b85b59
commit fabc4c7059
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E

View file

@ -135,12 +135,12 @@ if(!empty($_GET['common'])) {
if(isset($soundInfo->sources->mp3))
$config['soundFiles'][strtr($soundInfo->name, [':' => '_', '-' => '_'])] = $soundInfo->sources->mp3;
$emotesUrl = 'https:' . $common->api . '/v1/emotes';
$emotesUrl = 'https:' . $common->api . '/v1/emotes?fields=strings,uri,min_rank';
$emotes = json_decode(file_get_contents($emotesUrl));
foreach($emotes as $emoteInfo)
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;
$config['emoticonFiles'][] = str_starts_with($emoteInfo->uri, 'https:') ? substr($emoteInfo->uri, 6) : $emoteInfo->uri;
}
header('Content-Type: application/javascript; charset=utf-8');