forked from AkkomaGang/akkoma-fe
Add toggle to hide posts mentioning blocked users (#78)
Reviewed-on: AkkomaGang/pleroma-fe#78 Co-authored-by: sfr <sol@solfisher.com> Co-committed-by: sfr <sol@solfisher.com>
This commit is contained in:
parent
5135720adc
commit
097823d790
5 changed files with 36 additions and 2 deletions
|
@ -37,6 +37,15 @@
|
||||||
{{ $t('settings.hide_muted_posts') }}
|
{{ $t('settings.hide_muted_posts') }}
|
||||||
</BooleanSetting>
|
</BooleanSetting>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<BooleanSetting
|
||||||
|
v-if="user"
|
||||||
|
:disabled="hideFilteredStatuses"
|
||||||
|
path="hideThreadsWithBlockedUsers"
|
||||||
|
>
|
||||||
|
{{ $t('settings.hide_threads_with_blocked_users') }}
|
||||||
|
</BooleanSetting>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|
|
@ -261,6 +261,22 @@ const Status = {
|
||||||
hasMentionsLine () {
|
hasMentionsLine () {
|
||||||
return this.mentionsLine.length > 0
|
return this.mentionsLine.length > 0
|
||||||
},
|
},
|
||||||
|
mentionsBlockedUser () {
|
||||||
|
// XXX: doesn't work on domain blocks, because users from blocked domains
|
||||||
|
// don't appear in `attentions' and therefore cannot be filtered.
|
||||||
|
let mentions = false
|
||||||
|
|
||||||
|
// find if user in mentions list is blocked
|
||||||
|
this.status.attentions.forEach((attn) => {
|
||||||
|
if (attn.id === this.currentUser.id) return
|
||||||
|
const relationship = this.$store.getters.relationship(attn.id)
|
||||||
|
if (relationship.blocking) {
|
||||||
|
mentions = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return mentions
|
||||||
|
},
|
||||||
muted () {
|
muted () {
|
||||||
if (this.statusoid.user.id === this.currentUser.id) return false
|
if (this.statusoid.user.id === this.currentUser.id) return false
|
||||||
const reasonsToMute = this.userIsMuted ||
|
const reasonsToMute = this.userIsMuted ||
|
||||||
|
@ -269,7 +285,9 @@ const Status = {
|
||||||
// Wordfiltered
|
// Wordfiltered
|
||||||
this.muteWordHits.length > 0 ||
|
this.muteWordHits.length > 0 ||
|
||||||
// bot status
|
// bot status
|
||||||
(this.muteBotStatuses && this.botStatus && !this.compact)
|
(this.muteBotStatuses && this.botStatus && !this.compact) ||
|
||||||
|
// mentions blocked user
|
||||||
|
this.mentionsBlockedUser
|
||||||
return !this.unmuted && !this.shouldNotMute && reasonsToMute
|
return !this.unmuted && !this.shouldNotMute && reasonsToMute
|
||||||
},
|
},
|
||||||
userIsMuted () {
|
userIsMuted () {
|
||||||
|
@ -312,6 +330,9 @@ const Status = {
|
||||||
hideFilteredStatuses () {
|
hideFilteredStatuses () {
|
||||||
return this.mergedConfig.hideFilteredStatuses
|
return this.mergedConfig.hideFilteredStatuses
|
||||||
},
|
},
|
||||||
|
hideThreadsWithBlockedUsers () {
|
||||||
|
return this.mergedConfig.hideThreadsWithBlockedUsers
|
||||||
|
},
|
||||||
hideWordFilteredPosts () {
|
hideWordFilteredPosts () {
|
||||||
return this.mergedConfig.hideWordFilteredPosts
|
return this.mergedConfig.hideWordFilteredPosts
|
||||||
},
|
},
|
||||||
|
@ -320,7 +341,8 @@ const Status = {
|
||||||
(this.muted && this.hideFilteredStatuses) ||
|
(this.muted && this.hideFilteredStatuses) ||
|
||||||
(this.userIsMuted && this.hideMutedUsers) ||
|
(this.userIsMuted && this.hideMutedUsers) ||
|
||||||
(this.status.thread_muted && this.hideMutedThreads) ||
|
(this.status.thread_muted && this.hideMutedThreads) ||
|
||||||
(this.muteWordHits.length > 0 && this.hideWordFilteredPosts)
|
(this.muteWordHits.length > 0 && this.hideWordFilteredPosts) ||
|
||||||
|
(this.mentionsBlockedUser && this.hideThreadsWithBlockedUsers)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
isFocused () {
|
isFocused () {
|
||||||
|
|
|
@ -424,6 +424,7 @@
|
||||||
"hide_shoutbox": "Hide instance shoutbox",
|
"hide_shoutbox": "Hide instance shoutbox",
|
||||||
"right_sidebar": "Reverse order of columns",
|
"right_sidebar": "Reverse order of columns",
|
||||||
"always_show_post_button": "Always show floating New Post button",
|
"always_show_post_button": "Always show floating New Post button",
|
||||||
|
"hide_threads_with_blocked_users": "Hide threads tagging blocked users",
|
||||||
"hide_wallpaper": "Hide instance wallpaper",
|
"hide_wallpaper": "Hide instance wallpaper",
|
||||||
"preload_images": "Preload images",
|
"preload_images": "Preload images",
|
||||||
"use_one_click_nsfw": "Open NSFW attachments with just one click",
|
"use_one_click_nsfw": "Open NSFW attachments with just one click",
|
||||||
|
|
|
@ -31,6 +31,7 @@ export const defaultState = {
|
||||||
// bad name: actually hides posts of muted USERS
|
// bad name: actually hides posts of muted USERS
|
||||||
hideMutedPosts: undefined, // instance default
|
hideMutedPosts: undefined, // instance default
|
||||||
hideMutedThreads: undefined, // instance default
|
hideMutedThreads: undefined, // instance default
|
||||||
|
hideThreadsWithBlockedUsers: undefined, // instance default
|
||||||
hideWordFilteredPosts: undefined, // instance default
|
hideWordFilteredPosts: undefined, // instance default
|
||||||
muteBotStatuses: undefined, // instance default
|
muteBotStatuses: undefined, // instance default
|
||||||
collapseMessageWithSubject: true, // instance default
|
collapseMessageWithSubject: true, // instance default
|
||||||
|
|
|
@ -30,6 +30,7 @@ const defaultState = {
|
||||||
// bad name: actually hides posts of muted USERS
|
// bad name: actually hides posts of muted USERS
|
||||||
hideMutedPosts: false,
|
hideMutedPosts: false,
|
||||||
hideMutedThreads: true,
|
hideMutedThreads: true,
|
||||||
|
hideThreadsWithBlockedUsers: false,
|
||||||
hideWordFilteredPosts: false,
|
hideWordFilteredPosts: false,
|
||||||
hidePostStats: false,
|
hidePostStats: false,
|
||||||
hideBotIndication: false,
|
hideBotIndication: false,
|
||||||
|
|
Loading…
Reference in a new issue