fix: store server id in redis and in room metadata to be able to delete voice state in all scenarios (#656)
* fix: store server id in redis values and in room metadata to be able to fully delete voice state in all scenarios * fix: undo logging change
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
use revolt_database::{
|
||||
util::reference::Reference,
|
||||
voice::{is_in_voice_channel, remove_user_from_voice_channel, VoiceClient},
|
||||
Channel, Database, User, AMQP,
|
||||
AMQP, Channel, Database, User, util::reference::Reference, voice::{UserVoiceChannel, VoiceClient, is_in_voice_channel, remove_user_from_voice_channel}
|
||||
};
|
||||
use revolt_permissions::ChannelPermission;
|
||||
use revolt_result::{create_error, Result};
|
||||
@@ -54,8 +52,10 @@ pub async fn remove_member(
|
||||
return Err(create_error!(InvalidOperation));
|
||||
};
|
||||
|
||||
if is_in_voice_channel(&member.id, channel.id()).await? {
|
||||
remove_user_from_voice_channel(db, voice_client, channel.id(), &member.id).await?;
|
||||
let user_voice_channel = UserVoiceChannel::from_channel(&channel);
|
||||
|
||||
if is_in_voice_channel(member.id, &user_voice_channel).await? {
|
||||
remove_user_from_voice_channel(voice_client, &user_voice_channel, member.id).await?;
|
||||
};
|
||||
|
||||
Ok(EmptyResponse)
|
||||
|
||||
Reference in New Issue
Block a user