Compare commits

..

1 Commits

Author SHA1 Message Date
Zomatree
c5eb48450b fix: include channel ids in UserMoveVoiceChannel 2025-10-22 19:54:24 +01:00
5 changed files with 4 additions and 10 deletions

1
Cargo.lock generated
View File

@@ -6905,7 +6905,6 @@ dependencies = [
"revolt_rocket_okapi",
"rocket",
"schemars 0.8.22",
"sentry",
"serde",
"serde_json",
"utoipa",

View File

@@ -16,7 +16,7 @@ mod voice_client;
pub use voice_client::VoiceClient;
async fn get_connection() -> Result<Conn> {
_get_connection().await.map_err(|_| create_error!(InternalError))
_get_connection().await.to_internal_error()
}
pub async fn raise_if_in_voice(user: &User, channel_id: &str) -> Result<()> {

View File

@@ -15,9 +15,8 @@ utoipa = ["dep:utoipa"]
rocket = ["dep:rocket", "dep:serde_json"]
axum = ["dep:axum", "dep:serde_json"]
okapi = ["dep:revolt_rocket_okapi", "dep:revolt_okapi", "schemas"]
sentry = ["dep:sentry"]
default = ["serde", "sentry"]
default = ["serde"]
[dependencies]
# Serialisation
@@ -37,5 +36,3 @@ revolt_okapi = { version = "0.9.1", optional = true }
log = "0.4"
# Axum
axum = { version = "0.7.5", optional = true }
sentry = { version = "0.31.5", optional = true }

View File

@@ -226,7 +226,7 @@ pub trait ToRevoltError<T> {
fn to_internal_error(self) -> Result<T, Error>;
}
impl<T, E: std::fmt::Debug + std::error::Error> ToRevoltError<T> for Result<T, E> {
impl<T, E: std::fmt::Debug> ToRevoltError<T> for Result<T, E> {
#[track_caller]
fn to_internal_error(self) -> Result<T, Error> {
let loc = Location::caller();
@@ -234,8 +234,6 @@ impl<T, E: std::fmt::Debug + std::error::Error> ToRevoltError<T> for Result<T, E
self
.map_err(|e| {
log::error!("{e:?}");
#[cfg(feature = "sentry")]
sentry::capture_error(&e);
Error {
error_type: ErrorType::InternalError,

View File

@@ -217,7 +217,7 @@ pub async fn edit(
EventV1::UserMoveVoiceChannel {
node: new_node,
from: channel,
from: old_voice_channel.id().to_string(),
to: new_voice_channel.id().to_string(),
token,
}