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