Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: server emoji count can be 1 more than the set limit #295

Closed
amycatgirl opened this issue Dec 4, 2023 · 2 comments · Fixed by #296
Closed

bug: server emoji count can be 1 more than the set limit #295

amycatgirl opened this issue Dec 4, 2023 · 2 comments · Fixed by #296

Comments

@amycatgirl
Copy link
Contributor

What happened?

As pointed out by Toatrika#5321 on Revolt's Server, It seems like servers can have exactly one more emoji than the limit imposed by the server.

I checked the source code and found out that in line 48 of customization/emoji_create.rs, the backend is checking if the server's emoji count is greater than the maximum limit, which means that a server can have 101 emotes.

Proposed change (literally 2 characters that I am too lazy to change)

// ...

- if emojis.len() > config.features.limits.default.server_emoji {
+ if emojis.len() >= config.features.limits.default.server_emoji {
                return Err(create_error!(TooManyEmoji {
                    max: config.features.limits.default.server_emoji,
                }));
            }

// ...
@Toatrika
Copy link

Toatrika commented Dec 4, 2023

i think in addition to this the default emoji limit should be increased from 100 to 101 to keep consistency (some servers currently have 101 emotes)

@DevSmoger
Copy link

I found also this same bug. When Emojis reach to 100 and you delete saved emojis from the list, it doesn't delete older ones and after that I'm able to save more emojis to list, now there is 102 of them. Didn't check how many more this way I could add them.
Something is registering the delete button click, but the value doesn't decrees after that, it's like freeing up one slot and can add more then limit allows.
Revolt_j5XRdZibqj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants