fix(permissions): wire up MUTE_MEMBERS bitmask and fix member permissions in frontend

This commit is contained in:
2026-07-06 13:27:38 +00:00
parent b1b41ca5e1
commit 1d37284c25
3 changed files with 15 additions and 7 deletions
+11 -2
View File
@@ -5,6 +5,8 @@ import { api } from '../lib/api.ts';
import { VoiceControls } from './VoiceControls.tsx';
import { VideoGrid } from './VideoGrid.tsx';
import { AudioRenderers } from './AudioRenderers.tsx';
import { usePermissions } from '../lib/usePermissions.ts';
import { useChannelStore } from '../stores/channel.ts';
export function VoicePanel() {
const isConnected = useVoiceStore((state) => state.isConnected);
@@ -17,8 +19,15 @@ export function VoicePanel() {
const dismissWhisper = useVoiceStore((state) => state.dismissWhisper);
const currentUserId = useAuthStore((state) => state.user?.id);
const userPermissions = useServerStore((state) => state.userPermissions);
const canMute = userPermissions.mute_members || userPermissions.administrator;
const activeChannelId = useChannelStore((s) => s.activeChannelId);
const channelsByServer = useChannelStore((s) => s.channelsByServer);
const activeServerId = useServerStore((s) => s.activeServerId);
const serverId = activeChannelId
? Object.entries(channelsByServer).find(([_, channels]) => channels.some(c => c.id === activeChannelId))?.[0]
: null;
const { canMute } = usePermissions(serverId || activeServerId);
const handleMute = async (identity: string) => {
if (!currentRoom) return;