Forum: every member may upload an own avatar and ask for a conversation
- Own avatars: no longer from the Kereső rank; before the first nickname save the settings page says the upload comes right after it (that is why even an admin did not see it). - Conversation requests: any member from the first day (a newcomers' limit may come back later in may_request). - The terms (8.1, 8.4) and the docs follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
//! Own avatars: a member from the Kereső rank may upload a picture instead of
|
||||
//! a starter avatar. It is cut to a square, made small (256 pixels), stripped
|
||||
//! Own avatars: any member may upload a picture instead of a starter avatar. It is cut to a square, made small (256 pixels), stripped
|
||||
//! of its metadata (EXIF: camera, place) and kept in the object storage; the
|
||||
//! forum serves it. A moderator can put the starter avatar back.
|
||||
|
||||
@@ -17,7 +16,6 @@ use image::metadata::Orientation;
|
||||
use image::{DynamicImage, ImageDecoder, ImageFormat, ImageReader, Limits};
|
||||
use serde_json::{Value, json};
|
||||
use sha2::{Digest, Sha256};
|
||||
use time::OffsetDateTime;
|
||||
use uuid::Uuid;
|
||||
|
||||
use super::St;
|
||||
@@ -97,9 +95,6 @@ pub async fn forget(state: &crate::AppState, avatar: &str) {
|
||||
/// `PUT /v1/forum/me/avatar`: the picture's bytes as the body.
|
||||
pub async fn upload(State(state): St, viewer: Viewer, body: Bytes) -> ApiResult<Json<Value>> {
|
||||
let member = viewer.require_writer()?.clone();
|
||||
if member.rank(OffsetDateTime::now_utc()).is_newcomer() && !viewer.is_moderator() {
|
||||
return Err(ApiError::Forbidden("Saját képet a Kereső rangtól tölthetsz fel.".into()));
|
||||
}
|
||||
let Some(storage) = &state.storage else {
|
||||
return Err(ApiError::Forbidden("A képfeltöltés most nem érhető el.".into()));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user