only bugs man

This commit is contained in:
Mekan1206
2026-08-16 17:56:17 +05:00
parent 5a9ba0cc23
commit 9fd01d6f78
2 changed files with 32 additions and 10 deletions

View File

@@ -87,10 +87,15 @@ class SupportChatController extends Controller
public function read(Conversation $conversation): JsonResponse
{
$sender = $this->assertCanReply(request()->user(), $conversation);
$actor = request()->user();
$this->assertCanView($actor, $conversation);
$excludeId = ChatSupport::isOperator($actor)
? ChatSupport::user()->id
: $actor->id;
$conversation->messages()
->where('user_id', '!=', $sender->id)
->where('user_id', '!=', $excludeId)
->whereNull('seen_at')
->update(['seen_at' => now()]);