Allow muting sensitive posts in public timelines

This commit is contained in:
Alexander Tumin 2024-02-21 21:27:12 +03:00 committed by Henry Jameson
parent 15dde2d372
commit 59656af44c
8 changed files with 61 additions and 1 deletions

View File

@ -63,6 +63,13 @@ const QuickFilterSettings = {
const value = !this.muteBotStatuses
this.$store.dispatch('setOption', { name: 'muteBotStatuses', value })
}
},
muteSensitiveStatuses: {
get () { return this.mergedConfig.muteSensitiveStatuses },
set () {
const value = !this.muteSensitiveStatuses
this.$store.dispatch('setOption', { name: 'muteSensitiveStatuses', value })
}
}
}
}

View File

@ -71,6 +71,18 @@
:aria-hidden="true"
/>{{ $t('settings.mute_bot_posts') }}
</button>
<button
class="menu-item dropdown-item"
role="menuitemcheckbox"
:aria-checked="muteSensitiveStatuses"
@click="muteSensitiveStatuses = !muteSensitiveStatuses"
>
<span
class="input menu-checkbox"
:class="{ 'menu-checkbox-checked': muteSensitiveStatuses }"
:aria-hidden="true"
/>{{ $t('settings.mute_sensitive_posts') }}
</button>
<button
class="menu-item dropdown-item"
role="menuitemcheckbox"

View File

@ -61,6 +61,13 @@ const QuickViewSettings = {
const value = !this.muteBotStatuses
this.$store.dispatch('setOption', { name: 'muteBotStatuses', value })
}
},
muteSensitiveStatuses: {
get () { return this.mergedConfig.muteSensitiveStatuses },
set () {
const value = !this.muteSensitiveStatuses
this.$store.dispatch('setOption', { name: 'muteSensitiveStatuses', value })
}
}
}
}

View File

@ -44,6 +44,29 @@
{{ $t('settings.mute_bot_posts') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="muteSensitiveStatuses">
{{ $t('settings.mute_sensitive_posts') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="hideMutedFederationRestrictions">
{{ $t('settings.hide_muted_federation_restrictions') }}
</BooleanSetting>
<ul
class="setting-list suboptions"
:class="[{disabled: !streaming}]"
>
<li
v-for="item in muteFederationRestrictionsLevels"
:key="'mute_' + item + '_federation_restriction'"
>
<BooleanSetting :path="'muteFederationRestrictions.' + item">
{{ $t('settings.mute_' + item + '_federation_restriction') }}
</BooleanSetting>
</li>
</ul>
</li>
<li>
<BooleanSetting path="hidePostStats">
{{ $t('settings.hide_post_stats') }}

View File

@ -238,6 +238,9 @@ const Status = {
showActorTypeIndicator () {
return !this.hideBotIndication
},
sensitiveStatus () {
return this.status.nsfw
},
mentionsLine () {
if (!this.headTailLinks) return []
const writtenSet = new Set(this.headTailLinks.writtenMentions.map(_ => _.url))
@ -265,7 +268,9 @@ const Status = {
// Wordfiltered
this.muteWordHits.length > 0 ||
// bot status
(this.muteBotStatuses && this.botStatus && !this.compact)
(this.muteBotStatuses && this.botStatus && !this.compact) ||
// sensitive status
(this.muteSensitiveStatuses && this.sensitiveStatus && !this.compact)
return !this.unmuted && !this.shouldNotMute && reasonsToMute
},
userIsMuted () {
@ -371,6 +376,9 @@ const Status = {
muteBotStatuses () {
return this.mergedConfig.muteBotStatuses
},
muteSensitiveStatuses () {
return this.mergedConfig.muteSensitiveStatuses
},
hideBotIndication () {
return this.mergedConfig.hideBotIndication
},

View File

@ -501,6 +501,7 @@
"mute_bot_posts": "Mute bot posts",
"hide_actor_type_indication": "Hide actor type (bots, groups, etc.) indication in posts",
"hide_scrobbles": "Hide scrobbles",
"mute_sensitive_posts": "Mute sensitive posts",
"hide_all_muted_posts": "Hide muted posts",
"max_thumbnails": "Maximum amount of thumbnails per post (empty = no limit)",
"hide_isp": "Hide instance-specific panel",

View File

@ -36,6 +36,7 @@ export const defaultState = {
hideMutedThreads: undefined, // instance default
hideWordFilteredPosts: undefined, // instance default
muteBotStatuses: undefined, // instance default
muteSensitiveStatuses: undefined, // instance default
collapseMessageWithSubject: undefined, // instance default
padEmoji: true,
hideAttachments: false,

View File

@ -71,6 +71,7 @@ const defaultState = {
hideSitename: false,
hideUserStats: false,
muteBotStatuses: false,
muteSensitiveStatuses: false,
modalOnRepeat: false,
modalOnUnfollow: false,
modalOnBlock: true,