mirror of
https://github.com/SrIzan10/hctv.git
synced 2026-06-06 00:56:56 +00:00
fix(chat): platform admin cannot moderate chats
This commit is contained in:
@@ -398,7 +398,8 @@ app.get(
|
||||
|
||||
const isModerator = Boolean(
|
||||
chatUser &&
|
||||
(chatUser.channelRole === 'owner' ||
|
||||
(chatUser.isPlatformAdmin ||
|
||||
chatUser.channelRole === 'owner' ||
|
||||
chatUser.channelRole === 'manager' ||
|
||||
chatUser.channelRole === 'chatModerator' ||
|
||||
chatUser.channelRole === 'botModerator')
|
||||
@@ -501,6 +502,13 @@ app.get(
|
||||
!socketState.targetUsername ||
|
||||
!socketState.channelId
|
||||
) {
|
||||
socket.send(
|
||||
JSON.stringify({
|
||||
type: 'moderationError',
|
||||
code: 'FORBIDDEN',
|
||||
message: 'You do not have permission to moderate this chat.',
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -553,6 +561,13 @@ app.get(
|
||||
!socketState.targetUsername ||
|
||||
!socketState.channelId
|
||||
) {
|
||||
socket.send(
|
||||
JSON.stringify({
|
||||
type: 'moderationError',
|
||||
code: 'FORBIDDEN',
|
||||
message: 'You do not have permission to moderate this chat.',
|
||||
})
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user