feat: hide status from suspended account (#1967)

This commit is contained in:
Shinigami 2023-04-16 14:22:03 +02:00 committed by GitHub
parent ce5e81e160
commit 3442dfe75d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 47 deletions

View file

@ -65,6 +65,8 @@ const isDM = $computed(() => status.visibility === 'direct')
const showUpperBorder = $computed(() => props.newer && !directReply) const showUpperBorder = $computed(() => props.newer && !directReply)
const showReplyTo = $computed(() => !replyToMain && !directReply) const showReplyTo = $computed(() => !replyToMain && !directReply)
const forceShow = ref(false)
</script> </script>
<template> <template>
@ -114,6 +116,20 @@ const showReplyTo = $computed(() => !replyToMain && !directReply)
</slot> </slot>
<div flex gap-3 :class="{ 'text-secondary': inNotification }"> <div flex gap-3 :class="{ 'text-secondary': inNotification }">
<template v-if="status.account.suspended && !forceShow">
<div flex="~col 1" min-w-0>
<p italic>
{{ $t('status.account.suspended_message') }}
</p>
<div>
<button p-0 flex="~ center" gap-2 text-sm btn-text @click="forceShow = true">
<div i-ri:eye-line />
<span>{{ $t('status.account.suspended_show') }}</span>
</button>
</div>
</div>
</template>
<template v-else>
<!-- Avatar --> <!-- Avatar -->
<div relative> <div relative>
<div v-if="collapseRebloggedBy" absolute flex items-center justify-center top--6px px-2px py-3px rounded-full bg-base> <div v-if="collapseRebloggedBy" absolute flex items-center justify-center top--6px px-2px py-3px rounded-full bg-base>
@ -168,6 +184,7 @@ const showReplyTo = $computed(() => !replyToMain && !directReply)
/> />
<StatusActions v-if="actions !== false" v-show="!userSettings.zenMode" :status="status" /> <StatusActions v-if="actions !== false" v-show="!userSettings.zenMode" :status="status" />
</div> </div>
</template>
</div> </div>
</StatusLink> </StatusLink>
</template> </template>

View file

@ -385,6 +385,10 @@
"uploading": "Hochladen..." "uploading": "Hochladen..."
}, },
"status": { "status": {
"account": {
"suspended_message": "Der Account dieses Status wurde vorübergehend gesperrt.",
"suspended_show": "Inhalt trotzdem anzeigen?"
},
"boosted_by": "Boosted von", "boosted_by": "Boosted von",
"edited": "Zuletzt bearbeitet: {0}", "edited": "Zuletzt bearbeitet: {0}",
"favourited_by": "Favorisiert von", "favourited_by": "Favorisiert von",

View file

@ -497,6 +497,10 @@
"uploading": "Uploading..." "uploading": "Uploading..."
}, },
"status": { "status": {
"account": {
"suspended_message": "The account of this status has been suspended.",
"suspended_show": "Show content anyways?"
},
"boosted_by": "Boosted By", "boosted_by": "Boosted By",
"edited": "Edited {0}", "edited": "Edited {0}",
"favourited_by": "Favorited By", "favourited_by": "Favorited By",