diff options
| author | Henry Jameson <me@hjkos.com> | 2022-03-13 16:34:05 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2022-03-13 16:34:05 +0200 |
| commit | f16f35a4d43fa1f5a13b7e8c1cde85737f5d2f32 (patch) | |
| tree | 88b2d75843e2679c9392e46b4dbc2b52a3366a72 /src | |
| parent | 5930b667a147a194993dba604dd617f926bb9d31 (diff) | |
| parent | 51b14cc61578c6aee80fbf63dce2dbb7503914bb (diff) | |
Merge remote-tracking branch 'origin/develop' into expert-settings-and-serverside
* origin/develop:
Update dependency v-click-outside to v2.1.5
Update dependency shelljs to v0.8.5
Update dependency portal-vue to v2.1.7
Update dependency lodash to v4.17.21
Update dependency karma-spec-reporter to v0.0.33
Update dependency karma-webpack to v4.0.2
Update dependency karma-sourcemap-loader to v0.3.8
Update dependency eslint-plugin-vue to v5.2.3
Update dependency chromedriver to v87.0.7
Update dependency @chenfengyuan/vue-qrcode to v1.0.2
Pin dependencies
Pin dependencies
Do not mute bot posts in notifications
Lint
Add renovate.json
Add bot indication to user icon on statuses
Mute bot posts
fix placeholder attachments opening new tab
Diffstat (limited to 'src')
| -rw-r--r-- | src/boot/after_store.js | 1 | ||||
| -rw-r--r-- | src/components/attachment/attachment.vue | 1 | ||||
| -rw-r--r-- | src/components/settings_modal/tabs/filtering_tab.vue | 13 | ||||
| -rw-r--r-- | src/components/status/status.js | 16 | ||||
| -rw-r--r-- | src/components/status/status.vue | 7 | ||||
| -rw-r--r-- | src/components/still-image/still-image.vue | 1 | ||||
| -rw-r--r-- | src/components/timeline/timeline_quick_settings.js | 7 | ||||
| -rw-r--r-- | src/components/timeline/timeline_quick_settings.vue | 9 | ||||
| -rw-r--r-- | src/components/user_avatar/user_avatar.js | 13 | ||||
| -rw-r--r-- | src/components/user_avatar/user_avatar.vue | 10 | ||||
| -rw-r--r-- | src/i18n/en.json | 2 | ||||
| -rw-r--r-- | src/modules/config.js | 2 | ||||
| -rw-r--r-- | src/modules/instance.js | 2 |
13 files changed, 80 insertions, 4 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js index cc0c7c5e..c4a0a800 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -115,6 +115,7 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => { copyInstanceOption('nsfwCensorImage') copyInstanceOption('background') copyInstanceOption('hidePostStats') + copyInstanceOption('hideBotIndication') copyInstanceOption('hideUserStats') copyInstanceOption('hideFilteredStatuses') copyInstanceOption('logo') diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index c4399f30..2a89886d 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -12,6 +12,7 @@ :href="attachment.url" :alt="attachment.description" :title="attachment.description" + @click.prevent > <FAIcon :icon="placeholderIconClass" /> <b>{{ nsfw ? "NSFW / " : "" }}</b>{{ edit ? '' : placeholderName }} diff --git a/src/components/settings_modal/tabs/filtering_tab.vue b/src/components/settings_modal/tabs/filtering_tab.vue index e60a8a85..81e9543b 100644 --- a/src/components/settings_modal/tabs/filtering_tab.vue +++ b/src/components/settings_modal/tabs/filtering_tab.vue @@ -44,9 +44,22 @@ path="hidePostStats" expert="1" > + </li> + <li> + <BooleanSetting path="muteBotStatuses"> + {{ $t('settings.mute_bot_posts') }} + </BooleanSetting> + </li> + <li> + <BooleanSetting path="hidePostStats"> {{ $t('settings.hide_post_stats') }} </BooleanSetting> </li> + <li> + <BooleanSetting path="hideBotIndication"> + {{ $t('settings.hide_bot_indication') }} + </BooleanSetting> + </li> <ChoiceSetting v-if="user" id="replyVisibility" diff --git a/src/components/status/status.js b/src/components/status/status.js index d8f94926..2c3e079f 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -166,6 +166,12 @@ const Status = { muteWordHits () { return muteWordHits(this.status, this.muteWords) }, + botStatus () { + return this.status.user.bot + }, + botIndicator () { + return this.botStatus && !this.hideBotIndication + }, mentionsLine () { if (!this.headTailLinks) return [] const writtenSet = new Set(this.headTailLinks.writtenMentions.map(_ => _.url)) @@ -191,7 +197,9 @@ const Status = { // Thread is muted status.thread_muted || // Wordfiltered - this.muteWordHits.length > 0 + this.muteWordHits.length > 0 || + // bot status + (this.muteBotStatuses && this.botStatus && !this.compact) return !this.unmuted && !this.shouldNotMute && reasonsToMute }, userIsMuted () { @@ -293,6 +301,12 @@ const Status = { hidePostStats () { return this.mergedConfig.hidePostStats }, + muteBotStatuses () { + return this.mergedConfig.muteBotStatuses + }, + hideBotIndication () { + return this.mergedConfig.hideBotIndication + }, currentUser () { return this.$store.state.users.currentUser }, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 3bb29db6..8f51a778 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -77,6 +77,7 @@ <UserAvatar v-if="retweet" class="left-side repeater-avatar" + :bot="botIndicator" :better-shadow="betterShadow" :user="statusoid.user" /> @@ -124,6 +125,7 @@ @click.stop.prevent.capture.native="toggleUserExpanded" > <UserAvatar + :bot="botIndicator" :compact="compact" :better-shadow="betterShadow" :user="status.user" @@ -407,7 +409,10 @@ class="gravestone" > <div class="left-side"> - <UserAvatar :compact="compact" /> + <UserAvatar + :compact="compact" + :bot="botIndicator" + /> </div> <div class="right-side"> <div class="deleted-text"> diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index cca75fcb..4ea21506 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -19,6 +19,7 @@ @load="onLoad" @error="onError" > + <slot/> </div> </template> diff --git a/src/components/timeline/timeline_quick_settings.js b/src/components/timeline/timeline_quick_settings.js index 7b4931ce..92d5ac14 100644 --- a/src/components/timeline/timeline_quick_settings.js +++ b/src/components/timeline/timeline_quick_settings.js @@ -53,6 +53,13 @@ const TimelineQuickSettings = { const value = !this.hideMutedPosts 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 }) + } } } } diff --git a/src/components/timeline/timeline_quick_settings.vue b/src/components/timeline/timeline_quick_settings.vue index 98996ebd..4d67e06b 100644 --- a/src/components/timeline/timeline_quick_settings.vue +++ b/src/components/timeline/timeline_quick_settings.vue @@ -41,6 +41,15 @@ </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 + class="button-default dropdown-item" @click="hideMedia = !hideMedia" > <span diff --git a/src/components/user_avatar/user_avatar.js b/src/components/user_avatar/user_avatar.js index 94653004..33d9a258 100644 --- a/src/components/user_avatar/user_avatar.js +++ b/src/components/user_avatar/user_avatar.js @@ -1,10 +1,21 @@ import StillImage from '../still-image/still-image.vue' +import { library } from '@fortawesome/fontawesome-svg-core' + +import { + faRobot +} from '@fortawesome/free-solid-svg-icons' + +library.add( + faRobot +) + const UserAvatar = { props: [ 'user', 'betterShadow', - 'compact' + 'compact', + 'bot' ], data () { return { diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue index 4040e263..29e03bcb 100644 --- a/src/components/user_avatar/user_avatar.vue +++ b/src/components/user_avatar/user_avatar.vue @@ -7,7 +7,9 @@ :src="imgSrc(user.profile_image_url_original)" :class="{ 'avatar-compact': compact, 'better-shadow': betterShadow }" :image-load-error="imageLoadError" - /> + > + <FAIcon v-if="bot" icon="robot" class="bot-indicator" /> + </StillImage> <div v-else class="Avatar -placeholder" @@ -36,6 +38,12 @@ height: 100%; } + & > .bot-indicator { + position: absolute; + bottom: 0; + right: 0; + } + &.better-shadow { box-shadow: var(--_avatarShadowInset); filter: var(--_avatarShadowFilter); diff --git a/src/i18n/en.json b/src/i18n/en.json index 05549682..61dd2538 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -354,6 +354,8 @@ "hide_attachments_in_tl": "Hide attachments in timeline", "hide_media_previews": "Hide media previews", "hide_muted_posts": "Hide posts of muted users", + "mute_bot_posts": "Mute bot posts", + "hide_bot_indication": "Hide bot indication in 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", diff --git a/src/modules/config.js b/src/modules/config.js index 86601564..1bb41b7d 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -28,6 +28,7 @@ export const defaultState = { hideMutedPosts: undefined, // instance default hideMutedThreads: undefined, // instance default hideWordFilteredPosts: undefined, // instance default + muteBotStatuses: undefined, // instance default collapseMessageWithSubject: undefined, // instance default padEmoji: true, hideAttachments: false, @@ -80,6 +81,7 @@ export const defaultState = { mentionLinkShowYous: undefined, // instance default mentionLinkBoldenYou: undefined, // instance default hidePostStats: undefined, // instance default + hideBotIndication: undefined, // instance default hideUserStats: undefined, // instance default virtualScrolling: undefined, // instance default sensitiveByDefault: undefined // instance default diff --git a/src/modules/instance.js b/src/modules/instance.js index 1abd784f..41bcf329 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -33,8 +33,10 @@ const defaultState = { hideMutedThreads: true, hideWordFilteredPosts: false, hidePostStats: false, + hideBotIndication: false, hideSitename: false, hideUserStats: false, + muteBotStatuses: false, loginMethod: 'password', logo: '/static/logo.svg', logoMargin: '.2em', |
