forked from jmug/stoatchat
Compare commits
1 Commits
20251022-3
...
20251020-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43118c853c |
@@ -295,9 +295,7 @@ pub enum EventV1 {
|
||||
},
|
||||
UserMoveVoiceChannel {
|
||||
node: String,
|
||||
from: String,
|
||||
to: String,
|
||||
token: String,
|
||||
token: String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user