forked from jmug/stoatchat
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
43118c853c |
@@ -295,9 +295,7 @@ pub enum EventV1 {
|
|||||||
},
|
},
|
||||||
UserMoveVoiceChannel {
|
UserMoveVoiceChannel {
|
||||||
node: String,
|
node: String,
|
||||||
from: String,
|
token: String
|
||||||
to: String,
|
|
||||||
token: String,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ struct MigrationInfo {
|
|||||||
revision: i32,
|
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) {
|
pub async fn migrate_database(db: &MongoDb) {
|
||||||
let migrations = db.col::<Document>("migrations");
|
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");
|
.expect("Failed to update voice channels");
|
||||||
};
|
};
|
||||||
|
|
||||||
if revision <= 48 {
|
if revision <= 47 {
|
||||||
info!("Running migration [revision 48 / 22-10-2025]: Add Video + Listen to default permissions");
|
info!("Running migration [revision 47 / 29-04-2025]: Add Video to default permissions");
|
||||||
|
|
||||||
db.col::<Document>("servers")
|
db.col::<Document>("servers")
|
||||||
.update_many(
|
.update_many(
|
||||||
@@ -1255,7 +1255,7 @@ pub async fn run_migrations(db: &MongoDb, revision: i32) -> i32 {
|
|||||||
doc! {
|
doc! {
|
||||||
"$bit": {
|
"$bit": {
|
||||||
"default_permissions": {
|
"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 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(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;
|
let _ = voice_client.remove_user(&node, &user.id, &channel_id).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -217,8 +217,6 @@ pub async fn edit(
|
|||||||
|
|
||||||
EventV1::UserMoveVoiceChannel {
|
EventV1::UserMoveVoiceChannel {
|
||||||
node: new_node,
|
node: new_node,
|
||||||
from: channel,
|
|
||||||
to: new_voice_channel.id().to_string(),
|
|
||||||
token,
|
token,
|
||||||
}
|
}
|
||||||
.p_user(target_user.id.clone(), db)
|
.p_user(target_user.id.clone(), db)
|
||||||
|
|||||||
Reference in New Issue
Block a user