This commit is contained in:
Felix Ableitner 2025-01-08 10:27:12 +01:00
parent 2ec8cd3a52
commit 961c7f1fcb
3 changed files with 11 additions and 0 deletions

View file

@ -71,6 +71,7 @@
# TODO: Unfortunately pictrs can only resize images to fit in a*a square, no rectangle.
# Otherwise we have to use crop, or use max_width/max_height which throws error
# if image is larger.
# TODO: whats a sensible default here?
max_banner_size: 512
# Prevent users from uploading images for posts or embedding in markdown. Avatars, icons and
# banners can still be uploaded.

View file

@ -9,6 +9,15 @@ pub mod download;
pub mod upload;
mod utils;
pub async fn delete_community_icon(
data: Json<DeleteImageParams>,
context: Data<LemmyContext>,
local_user_view: LocalUserView,
) -> LemmyResult<Json<SuccessResponse>> {
todo!()
}
// TODO: get rid of delete tokens and allow deletion by admin or uploader
pub async fn delete_image(
data: Json<DeleteImageParams>,
context: Data<LemmyContext>,

View file

@ -207,6 +207,7 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
.route("/ban_user", post().to(ban_from_community))
.route("/mod", post().to(add_mod_to_community))
.route("/icon", post().to(upload_community_icon))
.route("/icon", delete().to(delete_community_icon))
.route("/banner", post().to(upload_community_banner))
.service(
scope("/pending_follows")