refactor: remove USE_VOICE_ACTIVITY dead code and enforce STREAM permission in VoiceControlBar

Remove the unused USE_VOICE_ACTIVITY permission bit (was bit 25) and shift
STREAM to bit 25, DISCONNECT_MEMBERS to bit 26. Add a database migration to
remap stored permission values. Gate camera and screen share buttons in
VoiceControlBar behind canSpeak/canStream, matching VoiceControls behavior.
This commit is contained in:
Jannis Braun
2026-03-10 15:46:59 +01:00
parent ce63c5ed36
commit 2755cc0aac
5 changed files with 132 additions and 35 deletions
+3 -5
View File
@@ -21,9 +21,8 @@ export const PermissionBits = {
MUTE_MEMBERS: 1n << 22n,
DEAFEN_MEMBERS: 1n << 23n,
MOVE_MEMBERS: 1n << 24n,
USE_VOICE_ACTIVITY: 1n << 25n,
STREAM: 1n << 26n,
DISCONNECT_MEMBERS: 1n << 27n,
STREAM: 1n << 25n,
DISCONNECT_MEMBERS: 1n << 26n,
} as const;
export type PermissionBit = (typeof PermissionBits)[keyof typeof PermissionBits];
@@ -39,8 +38,7 @@ export const DEFAULT_EVERYONE_PERMISSIONS =
PermissionBits.ATTACH_FILES |
PermissionBits.READ_MESSAGE_HISTORY |
PermissionBits.ADD_REACTIONS |
PermissionBits.STREAM |
PermissionBits.USE_VOICE_ACTIVITY;
PermissionBits.STREAM;
// ─── Helpers ────────────────────────────────────────────────────────────────