Compare commits

..

1 Commits

Author SHA1 Message Date
Zomatree
43118c853c fix: dont break on user not still being in channel and force disconnecting 2025-10-20 00:07:06 +01:00
4 changed files with 6 additions and 10 deletions

View File

@@ -295,9 +295,7 @@ pub enum EventV1 {
},
UserMoveVoiceChannel {
node: String,
from: String,
to: String,
token: String,
token: String
}
}

View File

@@ -25,7 +25,7 @@ struct MigrationInfo {
revision: i32,
}
pub const LATEST_REVISION: i32 = 49; // MUST BE +1 to last migration
pub const LATEST_REVISION: i32 = 48; // MUST BE +1 to last migration
pub async fn migrate_database(db: &MongoDb) {
let migrations = db.col::<Document>("migrations");
@@ -1246,8 +1246,8 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
.expect("Failed to update voice channels");
};
if revision <= 48 {
info!("Running migration [revision 48 / 22-10-2025]: Add Video + Listen to default permissions");
if revision <= 47 {
info!("Running migration [revision 47 / 29-04-2025]: Add Video to default permissions");
db.col::<Document>("servers")
.update_many(
@@ -1255,7 +1255,7 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
doc! {
"$bit": {
"default_permissions": {
"or": (ChannelPermission::Video + ChannelPermission::Speak + ChannelPermission::Listen) as i64
"or": ChannelPermission::Video as i64
},
}
}

View File

@@ -59,7 +59,7 @@ pub async fn ban(
// If the member is in a voice channel while banned kick them from the voice channel
if let Some(channel_id) = get_user_voice_channel_in_server(&user.id, &server.id).await? {
if let Some(node) = get_channel_node(&channel_id).await? {
if let Some(node) = get_channel_node(&channel_id).await?.unwrap() {
let _ = voice_client.remove_user(&node, &user.id, &channel_id).await;
}

View File

@@ -217,8 +217,6 @@ pub async fn edit(
EventV1::UserMoveVoiceChannel {
node: new_node,
from: channel,
to: new_voice_channel.id().to_string(),
token,
}
.p_user(target_user.id.clone(), db)