forked from jmug/stoatchat
feat(core): separate limits for new user accounts
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user