Mute bot posts

This commit is contained in:
Alexander Tumin 2022-02-28 23:07:20 +03:00
parent 514d7d3f88
commit fe0ed7e8f0
7 changed files with 33 additions and 1 deletions

View file

@ -37,6 +37,11 @@
</li> </li>
</ul> </ul>
</li> </li>
<li>
<BooleanSetting path="muteBotStatuses">
{{ $t('settings.mute_bot_posts') }}
</BooleanSetting>
</li>
<li> <li>
<BooleanSetting path="hidePostStats"> <BooleanSetting path="hidePostStats">
{{ $t('settings.hide_post_stats') }} {{ $t('settings.hide_post_stats') }}

View file

@ -166,6 +166,9 @@ const Status = {
muteWordHits () { muteWordHits () {
return muteWordHits(this.status, this.muteWords) return muteWordHits(this.status, this.muteWords)
}, },
botStatus () {
return this.status.user.bot
},
mentionsLine () { mentionsLine () {
if (!this.headTailLinks) return [] if (!this.headTailLinks) return []
const writtenSet = new Set(this.headTailLinks.writtenMentions.map(_ => _.url)) const writtenSet = new Set(this.headTailLinks.writtenMentions.map(_ => _.url))
@ -191,7 +194,9 @@ const Status = {
// Thread is muted // Thread is muted
status.thread_muted || status.thread_muted ||
// Wordfiltered // Wordfiltered
this.muteWordHits.length > 0 this.muteWordHits.length > 0 ||
// bot status
(this.muteBotStatuses && this.botStatus)
return !this.unmuted && !this.shouldNotMute && reasonsToMute return !this.unmuted && !this.shouldNotMute && reasonsToMute
}, },
userIsMuted () { userIsMuted () {
@ -293,6 +298,9 @@ const Status = {
hidePostStats () { hidePostStats () {
return this.mergedConfig.hidePostStats return this.mergedConfig.hidePostStats
}, },
muteBotStatuses () {
return this.mergedConfig.muteBotStatuses
},
currentUser () { currentUser () {
return this.$store.state.users.currentUser return this.$store.state.users.currentUser
}, },

View file

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

View file

@ -39,6 +39,15 @@
class="dropdown-divider" class="dropdown-divider"
/> />
</div> </div>
<button
class="button-default dropdown-item"
@click="muteBotStatuses = !muteBotStatuses"
>
<span
class="menu-checkbox"
:class="{ 'menu-checkbox-checked': muteBotStatuses }"
/>{{ $t('settings.mute_bot_posts') }}
</button>
<button <button
class="button-default dropdown-item" class="button-default dropdown-item"
@click="hideMedia = !hideMedia" @click="hideMedia = !hideMedia"

View file

@ -351,6 +351,7 @@
"hide_attachments_in_tl": "Hide attachments in timeline", "hide_attachments_in_tl": "Hide attachments in timeline",
"hide_media_previews": "Hide media previews", "hide_media_previews": "Hide media previews",
"hide_muted_posts": "Hide posts of muted users", "hide_muted_posts": "Hide posts of muted users",
"mute_bot_posts": "Mute bot posts",
"hide_all_muted_posts": "Hide muted posts", "hide_all_muted_posts": "Hide muted posts",
"max_thumbnails": "Maximum amount of thumbnails per post (empty = no limit)", "max_thumbnails": "Maximum amount of thumbnails per post (empty = no limit)",
"hide_isp": "Hide instance-specific panel", "hide_isp": "Hide instance-specific panel",

View file

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

View file

@ -35,6 +35,7 @@ const defaultState = {
hidePostStats: false, hidePostStats: false,
hideSitename: false, hideSitename: false,
hideUserStats: false, hideUserStats: false,
muteBotStatuses: false,
loginMethod: 'password', loginMethod: 'password',
logo: '/static/logo.svg', logo: '/static/logo.svg',
logoMargin: '.2em', logoMargin: '.2em',