Merge branch 'main' into feat/livekit

This commit is contained in:
Zomatree
2025-07-01 20:22:34 +01:00
49 changed files with 995 additions and 470 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "revolt-models"
version = "0.8.7"
version = "0.8.8"
edition = "2021"
license = "MIT"
authors = ["Paul Makles <me@insrt.uk>"]
@@ -20,8 +20,8 @@ default = ["serde", "partials", "rocket"]
[dependencies]
# Core
revolt-config = { version = "0.8.7", path = "../config" }
revolt-permissions = { version = "0.8.7", path = "../permissions" }
revolt-config = { version = "0.8.8", path = "../config" }
revolt-permissions = { version = "0.8.8", path = "../permissions" }
# Utility
regex = "1.11"

View File

@@ -348,14 +348,14 @@ impl Channel {
/// This returns a Result because the recipient name can't be determined here without a db call,
/// which can't be done since this is models, which can't reference the database crate.
///
/// If it returns Err, you need to fetch the name from the db.
pub fn name(&self) -> Result<&str, ()> {
/// If it returns None, you need to fetch the name from the db.
pub fn name(&self) -> Option<&str> {
match self {
Channel::DirectMessage { .. } => Err(()),
Channel::SavedMessages { .. } => Ok("Saved Messages"),
Channel::DirectMessage { .. } => None,
Channel::SavedMessages { .. } => Some("Saved Messages"),
Channel::TextChannel { name, .. }
| Channel::Group { name, .. }
| Channel::VoiceChannel { name, .. } => Ok(name),
| Channel::VoiceChannel { name, .. } => Some(name),
}
}
}

View File

@@ -267,7 +267,7 @@ auto_derived!(
pub hoist: Option<bool>,
/// Ranking position
///
/// Smaller values take priority.
/// **Removed** - no effect, use the edit server role positions route
pub rank: Option<i64>,
/// Fields to remove from role object
#[cfg_attr(feature = "validator", validate(length(min = 1)))]
@@ -286,4 +286,9 @@ auto_derived!(
/// Whether to not send a leave message
pub leave_silently: Option<bool>,
}
/// New role positions
pub struct DataEditRoleRanks {
pub ranks: Vec<String>,
}
);