From 95ca735b7bf543a36abdb06541cd94c7225db74f Mon Sep 17 00:00:00 2001 From: Zomatree Date: Sun, 8 Jun 2025 02:33:35 +0100 Subject: [PATCH] fix: get_voice_state has incorrect unique_key and allowed_sources should be lowercase --- crates/core/database/src/voice/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/core/database/src/voice/mod.rs b/crates/core/database/src/voice/mod.rs index a01bf492..eb7ffdf1 100644 --- a/crates/core/database/src/voice/mod.rs +++ b/crates/core/database/src/voice/mod.rs @@ -102,11 +102,11 @@ pub fn get_allowed_sources(permissions: PermissionValue) -> Vec<&'static str> { let mut allowed_sources = Vec::new(); if permissions.has(ChannelPermission::Speak as u64) { - allowed_sources.push("MICROPHONE") + allowed_sources.push("microphone") }; if permissions.has(ChannelPermission::Video as u64) { - allowed_sources.extend(["CAMERA", "SCREEN_SHARE", "SCREEN_SHARE_AUDIO"]); + allowed_sources.extend(["camera", "screen_share", "screen_share_audio"]); }; allowed_sources @@ -259,7 +259,7 @@ pub async fn get_voice_state( server_id: Option<&str>, user_id: &str, ) -> Result> { - let unique_key = format!("{}:{user_id}", server_id.unwrap_or(channel_id)); + let unique_key = format!("{}:{}", user_id, server_id.unwrap_or(channel_id)); let (is_publishing, is_receiving, screensharing, camera) = get_connection() .await?