WIP
This commit is contained in:
@@ -15,7 +15,17 @@ use Illuminate\Support\Facades\DB;
|
||||
|
|
||||
*/
|
||||
|
||||
Broadcast::channel('chat.support', function ($user) {
|
||||
return ChatSupport::isOperator($user);
|
||||
});
|
||||
|
||||
Broadcast::channel('chat.{conversationId}', function ($user, $conversationId) {
|
||||
if (! ctype_digit((string) $conversationId)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$conversationId = (int) $conversationId;
|
||||
|
||||
$isParticipant = DB::table('conversation_user')
|
||||
->where('conversation_id', $conversationId)
|
||||
->where('user_id', $user->id)
|
||||
@@ -26,9 +36,5 @@ Broadcast::channel('chat.{conversationId}', function ($user, $conversationId) {
|
||||
}
|
||||
|
||||
return ChatSupport::isOperator($user)
|
||||
&& ChatSupport::conversationIncludesSupport((int) $conversationId);
|
||||
});
|
||||
|
||||
Broadcast::channel('chat.support', function ($user) {
|
||||
return ChatSupport::isOperator($user);
|
||||
&& ChatSupport::conversationIncludesSupport($conversationId);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user