feat: real-time SPEAK permission enforcement in voice channels
Permission changes now take effect immediately without requiring disconnect/reconnect. Modeled as "permission mute" parallel to server mute — server recomputes SPEAK for all voice participants on role/override changes and broadcasts state via WebSocket. Includes amber UI indicators and mic toggle blocking.
This commit is contained in:
@@ -6,6 +6,7 @@ import { generateSnowflake } from '../utils/snowflake.js';
|
||||
import { isMember, hasPermission, getChannelSpaceId, PermissionBits, computePermissions } from '../utils/permissions.js';
|
||||
import { permissionsToString } from '@backspace/shared/src/permissions.js';
|
||||
import { connectionManager } from '../ws/handler.js';
|
||||
import { checkVoicePermissions } from '../ws/events.js';
|
||||
import type {
|
||||
CreateChannelRequest,
|
||||
UpdateChannelRequest,
|
||||
@@ -356,6 +357,7 @@ export async function channelRoutes(app: FastifyInstance): Promise<void> {
|
||||
|
||||
// Notify all space members of the permission change
|
||||
broadcastOverrideChange(channel.spaceId, id);
|
||||
checkVoicePermissions(channel.spaceId);
|
||||
|
||||
return reply.code(200).send({ success: true });
|
||||
});
|
||||
@@ -387,6 +389,7 @@ export async function channelRoutes(app: FastifyInstance): Promise<void> {
|
||||
|
||||
// Notify all space members of the permission change
|
||||
broadcastOverrideChange(channel.spaceId, id);
|
||||
checkVoicePermissions(channel.spaceId);
|
||||
|
||||
return reply.code(200).send({ success: true });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user