mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
fix: add USE_VIDEO permission to Member role and fix single-user video mode
Two fixes: 1. Member role (0x663) was missing USE_VIDEO (0x800) and SHARE_SCREEN (0x1000) bits, causing "permission denied" when non-owner users tried to enable camera. Migration 006 updates Member permissions to 0x1E63. 2. checkVideoMode() now checks voice.localCamera immediately instead of waiting for the server's voice_state broadcast, so video grid shows instantly when a single user enables their camera.
This commit is contained in:
@@ -178,11 +178,13 @@ export function createMainPage(options: MainPageOptions): MountableComponent {
|
||||
if (isVideoMode) showChat();
|
||||
return;
|
||||
}
|
||||
let anyCameraOn = false;
|
||||
for (const user of channelUsers.values()) {
|
||||
if (user.camera) {
|
||||
anyCameraOn = true;
|
||||
break;
|
||||
let anyCameraOn = voice.localCamera; // Check local camera first (may not be in voiceUsers yet)
|
||||
if (!anyCameraOn) {
|
||||
for (const user of channelUsers.values()) {
|
||||
if (user.camera) {
|
||||
anyCameraOn = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (anyCameraOn && !isVideoMode) {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
-- Migration 006: Add video and screenshare permissions to Member role
|
||||
-- Member was missing USE_VIDEO (0x800) and SHARE_SCREEN (0x1000).
|
||||
-- New value: 0x1E63 = SEND_MESSAGES | READ_MESSAGES | ATTACH_FILES |
|
||||
-- ADD_REACTIONS | CONNECT_VOICE | SPEAK_VOICE |
|
||||
-- USE_VIDEO | SHARE_SCREEN
|
||||
UPDATE roles SET permissions = 7779 WHERE id = 4 AND name = 'Member';
|
||||
Reference in New Issue
Block a user