Count loads of old emote endpoint in case I forgot to replace anywhere.

This commit is contained in:
Pachira 2024-11-14 04:13:57 +00:00
parent 058b409adf
commit 174ceaa4e7
2 changed files with 7 additions and 2 deletions

View file

@ -269,7 +269,8 @@ class MisuzuContext {
$this->authCtx,
$this->emotes,
$this->perms,
$this->authInfo
$this->authInfo,
$this->counters
));
$routingCtx->register(new \Misuzu\Satori\SatoriRoutes(

View file

@ -4,6 +4,7 @@ namespace Misuzu\SharpChat;
use RuntimeException;
use Misuzu\RoutingContext;
use Misuzu\Auth\{AuthContext,AuthInfo,Sessions};
use Misuzu\Counters\Counters;
use Misuzu\Emoticons\Emotes;
use Misuzu\Perms\Permissions;
use Misuzu\Users\{Bans,UsersContext,UserInfo};
@ -25,7 +26,8 @@ final class SharpChatRoutes implements RouteHandler {
private AuthContext $authCtx,
private Emotes $emotes,
private Permissions $perms,
private AuthInfo $authInfo
private AuthInfo $authInfo,
private Counters $counters
) {
$this->hashKey = $this->config->getString('hashKey', 'woomy');
}
@ -40,6 +42,8 @@ final class SharpChatRoutes implements RouteHandler {
if($request->getMethod() === 'OPTIONS')
return 204;
$this->counters->increment('dev:legacy_emotes_loads');
$emotes = $this->emotes->getEmotes(orderBy: 'order');
$out = [];