Compare commits

...
4 Commits
5 changed files with 18 additions and 16 deletions
@@ -105,7 +105,7 @@ mod tests {
let fetched_strike = strikes
.into_iter()
.find(|strike| strike.id == strike.id)
.find(|entry| entry.id == strike.id)
.unwrap();
assert_eq!(fetched_strike, updated_strike);
+4 -2
View File
@@ -8,6 +8,8 @@ extern crate serde_json;
pub mod routes;
pub mod util;
use std::net::Ipv4Addr;
use async_std::channel::unbounded;
use revolt_quark::authifier::{Authifier, AuthifierEvent};
use revolt_quark::events::client::EventV1;
@@ -74,8 +76,8 @@ async fn rocket() -> _ {
.attach(revolt_quark::web::ratelimiter::RatelimitFairing)
.attach(cors)
.configure(rocket::Config {
limits: rocket::data::Limits::default()
.limit("string", 5.megabytes()),
limits: rocket::data::Limits::default().limit("string", 5.megabytes()),
address: Ipv4Addr::new(0, 0, 0, 0).into(),
..Default::default()
})
}
@@ -495,16 +495,6 @@ impl Channel {
.replace(replies.into_iter().collect::<Vec<String>>());
}
// Process included embeds.
let mut embeds = vec![];
for sendable_embed in data.embeds {
embeds.push(sendable_embed.into_embed(db, message_id.clone()).await?)
}
if !embeds.is_empty() {
message.embeds.replace(embeds);
}
// Add attachments to message.
let mut attachments = vec![];
if data.attachments.len() > *MAX_ATTACHMENT_COUNT {
@@ -524,6 +514,16 @@ impl Channel {
message.attachments.replace(attachments);
}
// Process included embeds.
let mut embeds = vec![];
for sendable_embed in data.embeds {
embeds.push(sendable_embed.into_embed(db, message_id.clone()).await?)
}
if !embeds.is_empty() {
message.embeds.replace(embeds);
}
// Set content
message.content = data.content;
+1 -1
View File
@@ -277,7 +277,7 @@ pub struct DataMessageSend {
///
/// Text embed content contributes to the content length cap
#[serde(default)]
#[validate(length(min = 1, max = 10))]
#[validate(length(min = 0, max = 10))]
pub embeds: Vec<SendableEmbed>,
/// Masquerade to apply to this message
#[validate]
+2 -2
View File
@@ -1,6 +1,6 @@
publish:
cargo publish --package revolt-result
cargo publish --package revolt-permissions
cargo publish --package revolt-database
cargo publish --package revolt-presence
cargo publish --package revolt-models
cargo publish --package revolt-presence
cargo publish --package revolt-database