diff --git a/src/SharpChat/SharpChatRoutes.php b/src/SharpChat/SharpChatRoutes.php index 052ffd0d..e55ea272 100644 --- a/src/SharpChat/SharpChatRoutes.php +++ b/src/SharpChat/SharpChatRoutes.php @@ -2,7 +2,6 @@ namespace Misuzu\SharpChat; use Misuzu\MszContext; -use Index\Http\HttpFx; // this should be replaced with an interface that implements the routes stuff // Replace use Misuzu\AuthToken; @@ -44,37 +43,20 @@ final class SharpChatRoutes { $response->setHeader('Access-Control-Allow-Origin', '*'); $response->setHeader('Access-Control-Allow-Methods', 'GET'); - $version = 1;//(int)$request->getParam('v', FILTER_SANITIZE_NUMBER_INT); - $raw = Emoticon::all(); $out = []; - if($version >= 2) { - foreach($raw as $emote) { - $strings = []; + foreach($raw as $emote) { + $strings = []; - foreach($emote->getStrings() as $string) - $strings[] = $string->emote_string; + foreach($emote->getStrings() as $string) + $strings[] = sprintf(':%s:', $string->emote_string); - $out[] = [ - 's' => $strings, - 'u' => $emote->getUrl(), - 'r' => $emote->getRank(), - ]; - } - } else { - foreach($raw as $emote) { - $strings = []; - - foreach($emote->getStrings() as $string) - $strings[] = sprintf(':%s:', $string->emote_string); - - $out[] = [ - 'Text' => $strings, - 'Image' => $emote->getUrl(), - 'Hierarchy' => $emote->getRank(), - ]; - } + $out[] = [ + 'Text' => $strings, + 'Image' => $emote->getUrl(), + 'Hierarchy' => $emote->getRank(), + ]; } return $out;