Add private calls
All checks were successful
Build and Release / build-and-release (push) Successful in 11m59s

This commit is contained in:
Bryan1029384756
2026-02-16 13:46:26 -06:00
parent 73b9da2003
commit 5ca0eeb6a4
13 changed files with 286 additions and 57 deletions

View File

@@ -64,6 +64,7 @@ export const VoiceProvider = ({ children }) => {
parseInt(localStorage.getItem('voiceOutputVolume') || '100')
);
const isMovingRef = useRef(false);
const isDMCallRef = useRef(false);
const [isReceivingScreenShareAudio, setIsReceivingScreenShareAudio] = useState(false);
const convex = useConvex();
@@ -226,8 +227,9 @@ export const VoiceProvider = ({ children }) => {
}
}
const connectToVoice = async (channelId, channelName, userId) => {
const connectToVoice = async (channelId, channelName, userId, isDMCall = false) => {
if (activeChannelId === channelId) return;
isDMCallRef.current = isDMCall;
if (room) await room.disconnect();
@@ -406,6 +408,7 @@ export const VoiceProvider = ({ children }) => {
useEffect(() => {
if (!activeChannelId || !serverSettings?.afkChannelId || isInAfkChannel) return;
if (!idle?.getSystemIdleTime) return;
if (isDMCallRef.current) return; // Skip AFK for DM calls
const afkTimeout = serverSettings.afkTimeout || 300;
const interval = setInterval(async () => {
@@ -603,6 +606,7 @@ export const VoiceProvider = ({ children }) => {
const disconnectVoice = () => {
console.log('User manually disconnected voice');
isDMCallRef.current = false;
if (room) room.disconnect();
};