From 174ceaa4e71b5b7763dccfb858cc569082e479e0 Mon Sep 17 00:00:00 2001 From: flashwave Date: Thu, 14 Nov 2024 04:13:57 +0000 Subject: [PATCH] Count loads of old emote endpoint in case I forgot to replace anywhere. --- src/MisuzuContext.php | 3 ++- src/SharpChat/SharpChatRoutes.php | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/MisuzuContext.php b/src/MisuzuContext.php index aa90aa5..0ee291f 100644 --- a/src/MisuzuContext.php +++ b/src/MisuzuContext.php @@ -269,7 +269,8 @@ class MisuzuContext { $this->authCtx, $this->emotes, $this->perms, - $this->authInfo + $this->authInfo, + $this->counters )); $routingCtx->register(new \Misuzu\Satori\SatoriRoutes( diff --git a/src/SharpChat/SharpChatRoutes.php b/src/SharpChat/SharpChatRoutes.php index cdf69e9..0641778 100644 --- a/src/SharpChat/SharpChatRoutes.php +++ b/src/SharpChat/SharpChatRoutes.php @@ -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 = [];