add setting to set boosts to be the same as default post visibility

This commit is contained in:
notfire 2025-02-10 10:50:58 -05:00
parent b457c07156
commit ae35c58425
Signed by: notfire
GPG key ID: 3AFDACAAB4E56B16
7 changed files with 25 additions and 1 deletions

View file

@ -25,7 +25,11 @@ const RetweetButton = {
},
doRetweet () {
if (!this.status.repeated) {
this.$store.dispatch('retweet', { id: this.status.id })
if (this.$store.getters.mergedConfig.boostsFollowDefVis) {
this.$store.dispatch('retweet_dv', { id: this.status.id })
} else {
this.$store.dispatch('retweet', { id: this.status.id })
}
} else {
this.$store.dispatch('unretweet', { id: this.status.id })
}

View file

@ -561,6 +561,11 @@
/>
</label>
</li>
<li>
<BooleanSetting path="boostsFollowDefVis">
{{ $t('settings.boosts_follow_def_vis') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting path="sensitiveByDefault">
{{ $t('settings.sensitive_by_default') }}

View file

@ -492,6 +492,7 @@
"block_import_error": "Error importing blocks",
"blocks_imported": "Blocks imported! Processing them will take a while.",
"blocks_tab": "Blocks",
"boosts_follow_def_vis": "Make boosts follow default visibility",
"bot": "This is a bot account",
"btnRadius": "Buttons",
"cBlue": "Blue (Reply, follow)",

View file

@ -112,6 +112,7 @@ export const defaultState = {
soundOnNotif: false,
soundOnNotifVolume: 0.2,
soundOnNotifCustom: '',
boostsFollowDefVis: false,
renderMisskeyMarkdown: undefined,
renderMfmOnHover: undefined, // instance default
conversationDisplay: undefined, // instance default

View file

@ -70,6 +70,7 @@ const defaultState = {
soundOnNotif: false,
soundOnNotifVolume: 0.2,
soundOnNotifCustom: '',
boostsFollowDefVis: false,
renderMisskeyMarkdown: true,
renderMfmOnHover: false,
conversationDisplay: 'linear',

View file

@ -669,6 +669,12 @@ const statuses = {
rootState.api.backendInteractor.retweet({ id: status.id })
.then(status => commit('setRetweetedConfirm', { status: status.retweeted_status, user: rootState.users.currentUser }))
},
retweet_dv ({ rootState, commit }, status) {
// Optimistic retweeting... ????????
commit('setRetweeted', { status, value: true })
rootState.api.backendInteractor.retweet_dv({ id: status.id, visibility: rootState.users.currentUser.default_scope })
.then(status => commit('setRetweetedConfirm', { status: status.retweeted_status, user: rootState.users.currentUser }))
},
unretweet ({ rootState, commit }, status) {
// Optimistic unretweeting...
commit('setRetweeted', { status, value: false })

View file

@ -844,6 +844,11 @@ const retweet = ({ id, credentials }) => {
.then((data) => parseStatus(data))
}
const retweet_dv = ({ id, credentials, visibility }) => {
return promisedRequest({ url: MASTODON_RETWEET_URL(id), method: 'POST', credentials, payload: {"visibility": visibility} })
.then((data) => parseStatus(data))
}
const unretweet = ({ id, credentials }) => {
return promisedRequest({ url: MASTODON_UNRETWEET_URL(id), method: 'POST', credentials })
.then((data) => parseStatus(data))
@ -1785,6 +1790,7 @@ const apiService = {
favorite,
unfavorite,
retweet,
retweet_dv,
unretweet,
bookmarkStatus,
unbookmarkStatus,