Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Allow custom emojis with image/webp media type
Browse files Browse the repository at this point in the history
  • Loading branch information
silverpill committed Apr 5, 2023
1 parent 9768fc6 commit b9fdb1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Increase maximum number of custom emojis per post to 50.
- Validate actor aliases before saving into database.
- Process incoming `Move()` activities in background.
- Allow custom emojis with `image/webp` media type.

## [1.19.1] - 2023-03-31

Expand Down
3 changes: 2 additions & 1 deletion src/validators/emojis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ use crate::errors::ValidationError;
const EMOJI_NAME_RE: &str = r"^[a-zA-Z0-9._-]+$";
pub const EMOJI_MAX_SIZE: usize = 500 * 1000; // 500 kB
pub const EMOJI_LOCAL_MAX_SIZE: usize = 50 * 1000; // 50 kB
pub const EMOJI_MEDIA_TYPES: [&str; 3] = [
pub const EMOJI_MEDIA_TYPES: [&str; 4] = [
"image/apng",
"image/gif",
"image/png",
"image/webp",
];

pub fn validate_emoji_name(emoji_name: &str) -> Result<(), ValidationError> {
Expand Down

0 comments on commit b9fdb1c

Please sign in to comment.