diff --git a/changelog.d/selfreproot.fix b/changelog.d/selfreproot.fix new file mode 100644 index 000000000..4c3faa838 --- /dev/null +++ b/changelog.d/selfreproot.fix @@ -0,0 +1 @@ +Allow repeats of own posts with private scopes diff --git a/src/components/status_action_buttons/action_button.js b/src/components/status_action_buttons/action_button.js index 07affaafe..8a65b9184 100644 --- a/src/components/status_action_buttons/action_button.js +++ b/src/components/status_action_buttons/action_button.js @@ -124,6 +124,7 @@ export default { } }, doActionWrap (button, close = () => {}) { + if (this.button.interactive ? !this.button.interactive(this.funcArg) : false) return this.$emit('interacted') if (button.name === 'emoji') { this.$refs.picker.showPicker() diff --git a/src/components/status_action_buttons/action_button.vue b/src/components/status_action_buttons/action_button.vue index ec13bd8bf..79082052a 100644 --- a/src/components/status_action_buttons/action_button.vue +++ b/src/components/status_action_buttons/action_button.vue @@ -12,7 +12,7 @@ :title="$t(button.label(funcArg))" target="_blank" :tabindex="0" - :disabled="buttonClass.disabled" + :disabled="this.button.interactive ? !this.button.interactive(this.funcArg) : false" :href="getComponent(button) == 'a' ? button.link?.(funcArg) || remoteInteractionLink : undefined" @click="doActionWrap(button, outerClose)" > diff --git a/src/components/status_action_buttons/buttons_definitions.js b/src/components/status_action_buttons/buttons_definitions.js index ecd4def70..bc1e45a98 100644 --- a/src/components/status_action_buttons/buttons_definitions.js +++ b/src/components/status_action_buttons/buttons_definitions.js @@ -30,8 +30,8 @@ export const BUTTONS = [{ label: ({ status }) => status.repeated ? 'tool_tip.unrepeat' : 'tool_tip.repeat', - icon ({ status }) { - if (PRIVATE_SCOPES.has(status.visibility)) { + icon ({ status, currentUser }) { + if (currentUser.id !== status.user.id && PRIVATE_SCOPES.has(status.visibility)) { return 'lock' } return 'retweet' @@ -40,7 +40,7 @@ export const BUTTONS = [{ active: ({ status }) => status.repeated, counter: ({ status }) => status.repeat_num, anonLink: true, - interactive: ({ status, loggedIn }) => loggedIn && !PRIVATE_SCOPES.has(status.visibility), + interactive: ({ status, currentUser }) => !!currentUser && (currentUser.id === status.user.id || !PRIVATE_SCOPES.has(status.visibility)), toggleable: true, confirm: ({ status, getters }) => !status.repeated && getters.mergedConfig.modalOnRepeat, confirmStrings: {