WIP
This commit is contained in:
1 parent
ab7cd8160f
commit
c55694ec8c
1 file changed
+11
-5
+11
-5
@@ -15,7 +15,17 @@
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Broadcast::channel('chat.support', function ($user) {
|
||||||
|
return ChatSupport::isOperator($user);
|
||||||
|
});
|
||||||
|
|
||||||
Broadcast::channel('chat.{conversationId}', function ($user, $conversationId) {
|
Broadcast::channel('chat.{conversationId}', function ($user, $conversationId) {
|
||||||
|
if (! ctype_digit((string) $conversationId)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$conversationId = (int) $conversationId;
|
||||||
|
|
||||||
$isParticipant = DB::table('conversation_user')
|
$isParticipant = DB::table('conversation_user')
|
||||||
->where('conversation_id', $conversationId)
|
->where('conversation_id', $conversationId)
|
||||||
->where('user_id', $user->id)
|
->where('user_id', $user->id)
|
||||||
@@ -26,9 +36,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
return ChatSupport::isOperator($user)
|
return ChatSupport::isOperator($user)
|
||||||
&& ChatSupport::conversationIncludesSupport((int) $conversationId);
|
&& ChatSupport::conversationIncludesSupport($conversationId);
|
||||||
});
|
|
||||||
|
|
||||||
Broadcast::channel('chat.support', function ($user) {
|
|
||||||
return ChatSupport::isOperator($user);
|
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user