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:
@@ -642,13 +642,7 @@ async fn private_messages_start_with_a_request(pool: PgPool) {
|
||||
async move { app.call("POST", "/v1/forum/conversations", Some(&user), body).await }
|
||||
};
|
||||
|
||||
// A newcomer may not start one; a seasoned member who wrote in public may.
|
||||
let (status, _) = request(&anna, "Holdfény", "Szia, olvastam a hozzászólásodat.").await;
|
||||
assert_eq!(status, StatusCode::FORBIDDEN);
|
||||
let profile = app.get("/v1/forum/members/Holdfény", Some(&anna)).await;
|
||||
assert_eq!(profile["relation"]["can_request"], false);
|
||||
app.thread(&anna, "torzsasztal", "Sziasztok").await;
|
||||
app.season(&anna, 5, 10).await;
|
||||
// Any member may start one from the first day (a newcomers' limit may come later).
|
||||
assert_eq!(app.get("/v1/forum/members/Holdfény", Some(&anna)).await["relation"]["can_request"], true);
|
||||
assert_eq!(request(&anna, "Holdfény", "Nézd: www.pelda.hu").await.0, StatusCode::BAD_REQUEST);
|
||||
assert_eq!(request(&anna, "Csendesvíz", "Szia, én vagyok.").await.0, StatusCode::BAD_REQUEST);
|
||||
@@ -1403,3 +1397,14 @@ async fn youtube_links_get_a_preview(pool: PgPool) {
|
||||
assert_eq!(shown["posts"][1]["links"][0]["title"], "Telihold meditáció");
|
||||
assert!(shown["posts"][0]["links"].is_null());
|
||||
}
|
||||
|
||||
#[sqlx::test(migrator = "db::MIGRATOR")]
|
||||
async fn any_member_may_upload_an_avatar(pool: PgPool) {
|
||||
let app = TestApp::new(pool);
|
||||
let anna = app.member("anna@example.com", "Csendesvíz", &["user"]).await;
|
||||
// A newcomer (Vándor) is offered it too; without storage the upload says it is not available.
|
||||
assert_eq!(app.get("/v1/forum/me", Some(&anna)).await["member"]["can_upload_avatar"], true);
|
||||
let (status, body) = app.call("PUT", "/v1/forum/me/avatar", Some(&anna), Value::Null).await;
|
||||
assert_eq!(status, StatusCode::FORBIDDEN);
|
||||
assert!(body.to_string().contains("nem érhető el"), "{body}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user