diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index 15542a11..c84942f3 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -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 }) } diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 82a83f05..4b33ec63 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -561,6 +561,11 @@ /> +
  • + + {{ $t('settings.boosts_follow_def_vis') }} + +
  • {{ $t('settings.sensitive_by_default') }} diff --git a/src/i18n/en.json b/src/i18n/en.json index 53606a72..b36bce1f 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -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)", diff --git a/src/modules/config.js b/src/modules/config.js index cff8580b..d18ee447 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -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 diff --git a/src/modules/instance.js b/src/modules/instance.js index fad5175c..d33932bf 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -70,6 +70,7 @@ const defaultState = { soundOnNotif: false, soundOnNotifVolume: 0.2, soundOnNotifCustom: '', + boostsFollowDefVis: false, renderMisskeyMarkdown: true, renderMfmOnHover: false, conversationDisplay: 'linear', diff --git a/src/modules/statuses.js b/src/modules/statuses.js index 19b5a7dd..604fb464 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -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 }) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 83c0b642..5c7d71be 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -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,