diff --git a/app/Singletons/OsuAuthorize.php b/app/Singletons/OsuAuthorize.php index 92143f27e22..27c14d000e0 100644 --- a/app/Singletons/OsuAuthorize.php +++ b/app/Singletons/OsuAuthorize.php @@ -1027,7 +1027,7 @@ public function checkChatChannelRead(?User $user, Channel $channel): string * @return string * @throws AuthorizationCheckException */ - public function checkChatChannelJoin(?User $user, Channel $channel): string + public function checkChatChannelJoin(?User $user, Channel $channel): ?string { $prefix = 'chat.'; @@ -1039,13 +1039,9 @@ public function checkChatChannelJoin(?User $user, Channel $channel): string $this->ensureCleanRecord($user, $prefix); - // This check is only for when joining the channel directly; joining via the Room - // will always add the user to the channel. + // joining multiplayer room is done through room endpoint if ($channel->isMultiplayer()) { - $room = Room::hasParticipated($user)->find($channel->room_id); - if ($room !== null) { - return 'ok'; - } + return null; } // allow joining of 'tournament' matches (for lazer/tournament client) diff --git a/tests/Controllers/Chat/ChannelsControllerTest.php b/tests/Controllers/Chat/ChannelsControllerTest.php index dac9bbc3b51..6b097bcc1cf 100644 --- a/tests/Controllers/Chat/ChannelsControllerTest.php +++ b/tests/Controllers/Chat/ChannelsControllerTest.php @@ -205,7 +205,7 @@ public function testChannelJoinMultiplayerWhenParticipated() 'user' => $this->user->getKey(), ])); - $request->assertStatus(200)->assertJsonFragment(['channel_id' => $scoreLink->playlistItem->room->channel_id, 'type' => Channel::TYPES['multiplayer']]); + $request->assertStatus(403); } //endregion