Implemented global match actor form edit.

This commit is contained in:
2026-06-09 04:22:41 +02:00
parent a2e2704a05
commit afe5876162
3 changed files with 10 additions and 5 deletions

View File

@@ -56,6 +56,7 @@ const keyMap = {
hasTattoos: 'has_tattoos',
hasPiercings: 'has_piercings',
isCircumcised: 'circumcised',
allowGlobalMatch: 'allow_global_match',
};
const socialsOrder = ['onlyfans', 'fansly', 'twitter', 'instagram', 'loyalfans', 'manyvids', 'pornhub', 'linktree', null];
@@ -131,6 +132,7 @@ export function curateActor(actor, context = {}) {
...actor.avatar,
sfw_media: actor.sfw_avatar,
}),
allowGlobalMatch: actor.allow_global_match,
socials: context.socials?.map((social) => ({
id: social.id,
url: social.url,
@@ -816,7 +818,7 @@ async function applyActorRevision(revisionIds, reqUser) {
return applyActorSocialsDelta(revision.actor_id, delta, trx);
}
if (delta.key === 'name' && reqUser.role === 'admin') {
if (['name', 'allowGlobalMatch'].includes(delta.key) && verifyAbility(reqUser, 'actor', 'update')) {
return applyActorDirectDelta(revision.actor_id, delta, trx);
}