fix: make reposts of nsfw posts nsfw

chore: update permission management uis
This commit is contained in:
trisua 2025-04-13 00:54:00 -04:00
parent c49e4458e2
commit 7b4865333e
5 changed files with 11 additions and 3 deletions

View file

@ -348,6 +348,7 @@
REQUESTED: 1 << 6,
MANAGE_PINS: 1 << 7,
MANAGE_COMMUNITY: 1 << 8,
MANAGE_QUESTIONS: 1 << 9,
},
],
);

View file

@ -230,6 +230,8 @@
BANNED: 1 << 17,
INFINITE_COMMUNITIES: 1 << 18,
SUPPORTER: 1 << 19,
MANAGE_REQUESTS: 1 << 20,
MANAGE_QUESTIONS: 1 << 21,
},
],
);

View file

@ -270,7 +270,7 @@ macro_rules! auto_method {
if !user.permissions.check(FinePermission::$permission) {
return Err(Error::NotAllowed);
} else {
self.create_audit_log_entry(crate::model::moderation::AuditLogEntry::new(
self.create_audit_log_entry($crate::model::moderation::AuditLogEntry::new(
user.id,
format!("invoked `{}` with x value `{x}`", stringify!($name)),
))
@ -303,7 +303,7 @@ macro_rules! auto_method {
if !user.permissions.check(FinePermission::$permission) {
return Err(Error::NotAllowed);
} else {
self.create_audit_log_entry(crate::model::moderation::AuditLogEntry::new(
self.create_audit_log_entry($crate::model::moderation::AuditLogEntry::new(
user.id,
format!("invoked `{}` with x value `{id}`", stringify!($name), id),
))

View file

@ -652,6 +652,11 @@ impl DataManager {
if let Some(ref rt) = reposting {
data.context.reposts_enabled = false; // cannot repost reposts
// mirror nsfw status
if rt.context.is_nsfw {
data.context.is_nsfw = true;
}
// make sure we aren't trying to repost a repost
if if let Some(ref repost) = rt.context.repost {
repost.reposting.is_some()

View file

@ -247,7 +247,7 @@ impl DataManager {
{
// requests are also deleted when a post is created answering the given question
// (unless the question is global)
self.delete_request(y.owner, y.id, &user).await?;
self.delete_request(y.owner, y.id, user).await?;
}
// return