feat(core): separate limits for new user accounts

This commit is contained in:
Paul Makles
2024-06-25 19:20:34 +01:00
parent e5eea267cf
commit 6ec8007e4e
9 changed files with 38 additions and 22 deletions

View File

@@ -30,11 +30,10 @@ pub async fn edit(
})
})?;
let config = config().await;
Message::validate_sum(
&edit.content,
edit.embeds.as_deref().unwrap_or_default(),
config.features.limits.default.message_length,
user.limits().await.message_length,
)?;
// Ensure we have permissions to send a message

View File

@@ -81,6 +81,7 @@ pub async fn message_send(
channel,
data,
v0::MessageAuthor::User(&author),
user.limits().await,
idempotency,
permissions.has_channel_permission(ChannelPermission::SendEmbeds),
allow_mentions,

View File

@@ -1,3 +1,4 @@
use revolt_config::config;
use revolt_database::{
util::{idempotency::IdempotencyKey, reference::Reference},
Database, Message,
@@ -58,6 +59,7 @@ pub async fn webhook_execute(
channel,
data,
v0::MessageAuthor::Webhook(&webhook.into()),
config().await.features.limits.default,
idempotency,
true,
true,