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 () { doRetweet () {
if (!this.status.repeated) { if (!this.status.repeated) {
if (this.$store.getters.mergedConfig.boostsFollowDefVis) {
this.$store.dispatch('retweet_dv', { id: this.status.id })
} else {
this.$store.dispatch('retweet', { id: this.status.id }) this.$store.dispatch('retweet', { id: this.status.id })
}
} else { } else {
this.$store.dispatch('unretweet', { id: this.status.id }) this.$store.dispatch('unretweet', { id: this.status.id })
} }

View file

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

View file

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

View file

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

View file

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

View file

@ -669,6 +669,12 @@ const statuses = {
rootState.api.backendInteractor.retweet({ id: status.id }) rootState.api.backendInteractor.retweet({ id: status.id })
.then(status => commit('setRetweetedConfirm', { status: status.retweeted_status, user: rootState.users.currentUser })) .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) { unretweet ({ rootState, commit }, status) {
// Optimistic unretweeting... // Optimistic unretweeting...
commit('setRetweeted', { status, value: false }) commit('setRetweeted', { status, value: false })

View file

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