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 showReplyTo = $computed(() => !replyToMain && !directReply)
const forceShow = ref(false)
</script>
<template>
@ -114,60 +116,75 @@ const showReplyTo = $computed(() => !replyToMain && !directReply)
</slot>
<div flex gap-3 :class="{ 'text-secondary': inNotification }">
<!-- Avatar -->
<div relative>
<div v-if="collapseRebloggedBy" absolute flex items-center justify-center top--6px px-2px py-3px rounded-full bg-base>
<div i-ri:repeat-fill text-green w-16px h-16px />
<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>
<AccountHoverWrapper :account="status.account">
<NuxtLink :to="getAccountRoute(status.account)" rounded-full>
<AccountBigAvatar :account="status.account" />
</NuxtLink>
</AccountHoverWrapper>
<div v-if="connectReply" w-full h-full flex mt--3px justify-center>
<div w-1px border="x base" />
</div>
</div>
<!-- Main -->
<div flex="~ col 1" min-w-0>
<!-- Account Info -->
<div flex items-center space-x-1>
</template>
<template v-else>
<!-- Avatar -->
<div relative>
<div v-if="collapseRebloggedBy" absolute flex items-center justify-center top--6px px-2px py-3px rounded-full bg-base>
<div i-ri:repeat-fill text-green w-16px h-16px />
</div>
<AccountHoverWrapper :account="status.account">
<StatusAccountDetails :account="status.account" />
<NuxtLink :to="getAccountRoute(status.account)" rounded-full>
<AccountBigAvatar :account="status.account" />
</NuxtLink>
</AccountHoverWrapper>
<div flex-auto />
<div v-show="!userSettings.zenMode" text-sm text-secondary flex="~ row nowrap" hover:underline whitespace-nowrap>
<AccountBotIndicator v-if="status.account.bot" me-2 />
<div flex="~ gap1" items-center>
<StatusVisibilityIndicator v-if="status.visibility !== 'public'" :status="status" />
<div flex>
<CommonTooltip :content="createdAt">
<NuxtLink :title="status.createdAt" :href="statusRoute.href" @click.prevent="go($event)">
<time text-sm ws-nowrap hover:underline :datetime="status.createdAt">
{{ timeago }}
</time>
</NuxtLink>
</CommonTooltip>
<StatusEditIndicator :status="status" inline />
<div v-if="connectReply" w-full h-full flex mt--3px justify-center>
<div w-1px border="x base" />
</div>
</div>
<!-- Main -->
<div flex="~ col 1" min-w-0>
<!-- Account Info -->
<div flex items-center space-x-1>
<AccountHoverWrapper :account="status.account">
<StatusAccountDetails :account="status.account" />
</AccountHoverWrapper>
<div flex-auto />
<div v-show="!userSettings.zenMode" text-sm text-secondary flex="~ row nowrap" hover:underline whitespace-nowrap>
<AccountBotIndicator v-if="status.account.bot" me-2 />
<div flex="~ gap1" items-center>
<StatusVisibilityIndicator v-if="status.visibility !== 'public'" :status="status" />
<div flex>
<CommonTooltip :content="createdAt">
<NuxtLink :title="status.createdAt" :href="statusRoute.href" @click.prevent="go($event)">
<time text-sm ws-nowrap hover:underline :datetime="status.createdAt">
{{ timeago }}
</time>
</NuxtLink>
</CommonTooltip>
<StatusEditIndicator :status="status" inline />
</div>
</div>
</div>
<StatusActionsMore v-if="actions !== false" :status="status" me--2 />
</div>
<StatusActionsMore v-if="actions !== false" :status="status" me--2 />
</div>
<!-- Content -->
<StatusContent
:status="status"
:newer="newer"
:context="context"
:is-preview="isPreview"
:in-notification="inNotification"
mb2 :class="{ 'mt-2 mb1': isDM }"
/>
<StatusActions v-if="actions !== false" v-show="!userSettings.zenMode" :status="status" />
</div>
<!-- Content -->
<StatusContent
:status="status"
:newer="newer"
:context="context"
:is-preview="isPreview"
:in-notification="inNotification"
mb2 :class="{ 'mt-2 mb1': isDM }"
/>
<StatusActions v-if="actions !== false" v-show="!userSettings.zenMode" :status="status" />
</div>
</template>
</div>
</StatusLink>
</template>

View file

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

View file

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