mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-09-09 11:45:18 -05:00
Added some more links to the chat messages list to easer go to the message users profile, inbox, bans etc.
This commit is contained in:
@@ -21,18 +21,24 @@ public function checkUsername(CheckUsernameRequest $request): mixed
|
||||
|
||||
public function checkChatMessage(CheckChatMessageRequest $request): mixed
|
||||
{
|
||||
// Lobby Host that send the request to check the message. We log him too since only the lobby host checks the messages in teh backend.
|
||||
$hostUser = Auth::user();
|
||||
// User that send the chat message
|
||||
$messageUser = User::find($request->userId);
|
||||
|
||||
$checker = Builder::blocker($request->message);
|
||||
|
||||
if($checker->clean())
|
||||
return response('{}');
|
||||
|
||||
$this->logBadMessage(Auth::user(), $request->message);
|
||||
$this->logBadMessage($hostUser, $messageUser, $request->message);
|
||||
return response('Bad Message >:(');
|
||||
}
|
||||
|
||||
public function logBadMessage(User $user, string $message): void {
|
||||
public function logBadMessage(User $hostUser, User $messageUser, string $message): void {
|
||||
$badMessage = new BadChatMessage();
|
||||
$badMessage->user()->associate($user);
|
||||
$badMessage->hostUser()->associate($hostUser);
|
||||
$badMessage->user()->associate($messageUser);
|
||||
$badMessage->message = $message;
|
||||
$badMessage->save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user