add: increase invite code limits

This commit is contained in:
trisua 2025-06-22 15:06:21 -04:00
parent 38ddf6cde1
commit dc74c5d63c
3 changed files with 7 additions and 4 deletions

View file

@ -256,6 +256,9 @@
MANAGE_STACKS: 1 << 26,
STAFF_BADGE: 1 << 27,
MANAGE_APPS: 1 << 28,
MANAGE_JOURNALS: 1 << 29,
MANAGE_NOTES: 1 << 30,
MANAGE_INVITES: 1 << 31,
},
],
);

View file

@ -536,7 +536,7 @@
(icon (text "plus"))
(str (text "settings:label.generate_invite")))
(text "{{ components::supporter_ad(body=\"Become a supporter to generate up to 24 invite codes! You can currently have 2 maximum.\") }} {% for code in invites %}")
(text "{{ components::supporter_ad(body=\"Become a supporter to generate up to 48 invite codes! You can currently have 2 maximum.\") }} {% for code in invites %}")
(div
("class" "card flex flex-col gap-2")
(text "{% if code[1].is_used -%}")
@ -673,7 +673,7 @@
(text "{% if config.security.enable_invite_codes -%}")
(li
(text "Create up to 24 invite codes"))
(text "Create up to 48 invite codes"))
(text "{%- endif %}"))
(a
("href" "{{ config.stripe.payment_link }}?client_reference_id={{ user.id }}")

View file

@ -68,8 +68,8 @@ impl DataManager {
Ok(out)
}
const MAXIMUM_FREE_INVITE_CODES: usize = 2;
const MAXIMUM_SUPPORTER_INVITE_CODES: usize = 24;
const MAXIMUM_FREE_INVITE_CODES: usize = 4;
const MAXIMUM_SUPPORTER_INVITE_CODES: usize = 48;
const MINIMUM_ACCOUNT_AGE_FOR_FREE_INVITE_CODES: usize = 2_629_800_000; // 1mo
/// Create a new invite_code in the database.