Compare commits

..
3 changed files with 9 additions and 5 deletions
+3 -1
View File
@@ -295,7 +295,9 @@ pub enum EventV1 {
},
UserMoveVoiceChannel {
node: String,
token: String
from: String,
to: String,
token: String,
}
}
@@ -25,7 +25,7 @@ struct MigrationInfo {
revision: i32,
}
pub const LATEST_REVISION: i32 = 48; // MUST BE +1 to last migration
pub const LATEST_REVISION: i32 = 49; // 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 <= 47 {
info!("Running migration [revision 47 / 29-04-2025]: Add Video to default permissions");
if revision <= 48 {
info!("Running migration [revision 48 / 22-10-2025]: Add Video + Listen 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 as i64
"or": (ChannelPermission::Video + ChannelPermission::Speak + ChannelPermission::Listen) as i64
},
}
}
@@ -217,6 +217,8 @@ pub async fn edit(
EventV1::UserMoveVoiceChannel {
node: new_node,
from: old_voice_channel.id().to_string(),
to: new_voice_channel.id().to_string(),
token,
}
.p_user(target_user.id.clone(), db)