Get post hiding back in gear
This commit is contained in:
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import {moderatePost} from '@atproto/api'
|
||||||
// AppBskyEmbedRecord,
|
|
||||||
// AppBskyEmbedRecordWithMedia,
|
|
||||||
moderatePost,
|
|
||||||
} from '@atproto/api'
|
|
||||||
|
|
||||||
type ModeratePost = typeof moderatePost
|
type ModeratePost = typeof moderatePost
|
||||||
type Options = Parameters<ModeratePost>[1] & {
|
type Options = Parameters<ModeratePost>[1] & {
|
||||||
@@ -13,47 +9,7 @@ export function moderatePost_wrapped(
|
|||||||
subject: Parameters<ModeratePost>[0],
|
subject: Parameters<ModeratePost>[0],
|
||||||
opts: Options,
|
opts: Options,
|
||||||
) {
|
) {
|
||||||
// const {hiddenPosts = [], ...options} = opts
|
const moderation = moderatePost(subject, opts)
|
||||||
const moderations = moderatePost(subject, opts) // options)
|
moderation.addHidden(opts.hiddenPosts?.includes(subject.uri) || false)
|
||||||
|
return moderation
|
||||||
// TODO
|
|
||||||
/*if (hiddenPosts.includes(subject.uri)) {
|
|
||||||
moderations.content.filter = true
|
|
||||||
moderations.content.blur = true
|
|
||||||
if (!moderations.content.cause) {
|
|
||||||
moderations.content.cause = {
|
|
||||||
// @ts-ignore Temporary extension to the moderation system -prf
|
|
||||||
type: 'post-hidden',
|
|
||||||
source: {type: 'user'},
|
|
||||||
priority: 1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (subject.embed) {
|
|
||||||
let embedHidden = false
|
|
||||||
if (AppBskyEmbedRecord.isViewRecord(subject.embed.record)) {
|
|
||||||
embedHidden = hiddenPosts.includes(subject.embed.record.uri)
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
AppBskyEmbedRecordWithMedia.isView(subject.embed) &&
|
|
||||||
AppBskyEmbedRecord.isViewRecord(subject.embed.record.record)
|
|
||||||
) {
|
|
||||||
embedHidden = hiddenPosts.includes(subject.embed.record.record.uri)
|
|
||||||
}
|
|
||||||
if (embedHidden) {
|
|
||||||
moderations.embed.filter = true
|
|
||||||
moderations.embed.blur = true
|
|
||||||
if (!moderations.embed.cause) {
|
|
||||||
moderations.embed.cause = {
|
|
||||||
// @ts-ignore Temporary extension to the moderation system -prf
|
|
||||||
type: 'post-hidden',
|
|
||||||
source: {type: 'user'},
|
|
||||||
priority: 1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
return moderations
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export function useModerationCauseDescription(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// @ts-ignore Temporary extension to the moderation system -prf
|
// @ts-ignore Temporary extension to the moderation system -prf
|
||||||
if (cause.type === 'post-hidden') {
|
if (cause.type === 'hidden') {
|
||||||
return {
|
return {
|
||||||
name: _(msg`Post Hidden by You`),
|
name: _(msg`Post Hidden by You`),
|
||||||
description: _(msg`You have hidden this post`),
|
description: _(msg`You have hidden this post`),
|
||||||
|
|||||||
Reference in New Issue
Block a user