add: ability to edit community title through ui

add: finish README
This commit is contained in:
trisua 2025-04-02 18:44:31 -04:00
parent 7c9d5de535
commit 53cf75b53c
11 changed files with 203 additions and 55 deletions

View file

@ -66,7 +66,7 @@ pub async fn proxy_request(
if let Some(ct) = stream.headers().get("Content-Type") {
let ct = ct.to_str().unwrap();
let bad_ct = vec!["text/html", "text/plain"];
let bad_ct = ["text/html", "text/plain"];
if (!ct.starts_with("image/") && !ct.starts_with("font/")) | bad_ct.contains(&ct) {
// if we got html, return default banner (likely an error page)
return (

View file

@ -233,12 +233,10 @@ pub async fn settings_request(
Err(e) => return Err(Html(render_error(e, &jar, &data, &Some(user)).await)),
};
if user.id != community.owner {
if !user.permissions.check(FinePermission::MANAGE_COMMUNITIES) {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &None).await,
));
}
if user.id != community.owner && !user.permissions.check(FinePermission::MANAGE_COMMUNITIES) {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &None).await,
));
}
// init context

View file

@ -121,17 +121,14 @@ pub async fn posts_request(
// check for private profile
if other_user.settings.private_profile {
if let Some(ref ua) = user {
if (ua.id != other_user.id) && !ua.permissions.check(FinePermission::MANAGE_USERS) {
if data
if (ua.id != other_user.id) && !ua.permissions.check(FinePermission::MANAGE_USERS) && data
.0
.get_userfollow_by_initiator_receiver(other_user.id, ua.id)
.await
.is_err()
{
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
.is_err() {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
} else {
return Err(Html(
@ -246,17 +243,14 @@ pub async fn following_request(
// check for private profile
if other_user.settings.private_profile {
if let Some(ref ua) = user {
if ua.id != other_user.id {
if data
if ua.id != other_user.id && data
.0
.get_userfollow_by_initiator_receiver(other_user.id, ua.id)
.await
.is_err()
{
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
.is_err() {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
} else {
return Err(Html(
@ -373,17 +367,14 @@ pub async fn followers_request(
// check for private profile
if other_user.settings.private_profile {
if let Some(ref ua) = user {
if ua.id != other_user.id {
if data
if ua.id != other_user.id && data
.0
.get_userfollow_by_initiator_receiver(other_user.id, ua.id)
.await
.is_err()
{
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
.is_err() {
return Err(Html(
render_error(Error::NotAllowed, &jar, &data, &user).await,
));
}
} else {
return Err(Html(