feat: drag-and-drop voice channel moves with federation fix

Add drag-and-drop support for moving users between voice channels
(MOVE_MEMBERS permission required). Fix voice_moved handler using
wrong user ID for federated users — now uses the same isHome/
getMyUserIdForOrigin pattern as adjacent voice handlers.
This commit is contained in:
Jannis Braun
2026-03-11 23:44:20 +01:00
parent 825e9975c8
commit 68a4c453de
3 changed files with 73 additions and 4 deletions
@@ -39,6 +39,9 @@ export function ChannelSidebar() {
const serverMutedUserIds = useVoiceStore((s) => s.serverMutedUserIds);
const serverDeafenedUserIds = useVoiceStore((s) => s.serverDeafenedUserIds);
const permissionMutedUserIds = useVoiceStore((s) => s.permissionMutedUserIds);
// Drag-and-drop state for moving users between voice channels
const [voiceDragState, setVoiceDragState] = useState<{ userId: string; fromChannelId: string } | null>(null);
const isServerMuted = !!(myOriginId && spaceId && serverMutedUserIds.has(`${spaceId}:${myOriginId}`));
const isServerDeafened = !!(myOriginId && spaceId && serverDeafenedUserIds.has(`${spaceId}:${myOriginId}`));
const isPermissionMuted = !!(myOriginId && spaceId && permissionMutedUserIds.has(`${spaceId}:${myOriginId}`));
@@ -470,6 +473,9 @@ export function ChannelSidebar() {
channelName={channel.name}
onClick={() => canConnect && handleVoiceJoin(channel.id)}
locked={!canConnect}
dragState={voiceDragState}
onDragStart={(userId: string) => setVoiceDragState({ userId, fromChannelId: channel.id })}
onDragEnd={() => setVoiceDragState(null)}
/>
);
})}