add: infinite post drafts for supporters

This commit is contained in:
trisua 2025-05-17 20:02:55 -04:00
parent f6cbeb9bd8
commit abc597de95
4 changed files with 21 additions and 3 deletions

View file

@ -117,6 +117,8 @@ impl DataManager {
Ok(res.unwrap())
}
const MAXIMUM_FREE_STACKS: usize = 5;
/// Create a new stack in the database.
///
/// # Arguments
@ -134,9 +136,8 @@ impl DataManager {
if !owner.permissions.check(FinePermission::SUPPORTER) {
let stacks = self.get_stacks_by_owner(data.owner).await?;
let maximum_count = 5;
if stacks.len() >= maximum_count {
if stacks.len() >= Self::MAXIMUM_FREE_STACKS {
return Err(Error::MiscError(
"You already have the maximum number of stacks you can have".to_string(),
));