From e50fe8ba187c3ca5f8983f42f6a2c3f59482a5aa Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 25 Jan 2026 22:20:11 -0800 Subject: [PATCH] compose: force local-only quotes of local-only Co-authored-by: Jessica Stokes --- .../mastodon/features/compose/components/compose_form.jsx | 8 +++++++- .../features/compose/containers/compose_form_container.js | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx index 0fcdbb64c..b6be52e07 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.jsx +++ b/app/javascript/mastodon/features/compose/components/compose_form.jsx @@ -67,6 +67,7 @@ class ComposeForm extends ImmutablePureComponent { onChangeSpoilerText: PropTypes.func.isRequired, onPaste: PropTypes.func.isRequired, onPickEmoji: PropTypes.func.isRequired, + disableFederation: PropTypes.func.isRequired, autoFocus: PropTypes.bool, withoutNavigation: PropTypes.bool, anyMedia: PropTypes.bool, @@ -192,6 +193,10 @@ class ComposeForm extends ImmutablePureComponent { componentDidUpdate (prevProps) { this._updateFocusAndSelection(prevProps); + + if (this.props.quoteOfLocalOnly && prevProps.quoteOfLocalOnly !== this.props.quoteOfLocalOnly) { + this.props.disableFederation(); + } } _updateFocusAndSelection = (prevProps) => { @@ -253,6 +258,7 @@ class ComposeForm extends ImmutablePureComponent { render () { const { intl, onPaste, autoFocus, withoutNavigation, maxChars, isSubmitting } = this.props; const { highlighted } = this.state; + const disabled = this.props.quoteOfLocalOnly || this.props.isEditing; return (
@@ -265,7 +271,7 @@ class ComposeForm extends ImmutablePureComponent {
- +
diff --git a/app/javascript/mastodon/features/compose/containers/compose_form_container.js b/app/javascript/mastodon/features/compose/containers/compose_form_container.js index ed6d8fb06..2c2c4328b 100644 --- a/app/javascript/mastodon/features/compose/containers/compose_form_container.js +++ b/app/javascript/mastodon/features/compose/containers/compose_form_container.js @@ -2,6 +2,7 @@ import { connect } from 'react-redux'; import { changeCompose, + changeComposeFederation, submitCompose, clearComposeSuggestions, fetchComposeSuggestions, @@ -40,6 +41,9 @@ const mapStateToProps = state => ({ && state.getIn(['compose', 'privacy']) === 'private' && state.getIn(['statuses', state.getIn(['compose', 'quoted_status_id']), 'account']) !== me && !state.getIn(['settings', 'dismissed_banners', PRIVATE_QUOTE_MODAL_ID]), + quoteOfLocalOnly: + !!state.getIn(['compose', 'quoted_status_id']) + && state.getIn(['statuses', state.getIn(['compose', 'quoted_status_id']), 'local_only']), isInReply: state.getIn(['compose', 'in_reply_to']) !== null, lang: state.getIn(['compose', 'language']), maxChars: state.getIn(['server', 'server', 'configuration', 'statuses', 'max_characters'], 500), @@ -108,6 +112,10 @@ const mapDispatchToProps = (dispatch, props) => ({ dispatch(insertEmojiCompose(position, data, needsSpace)); }, + disableFederation () { + dispatch(changeComposeFederation(false)); + }, + }); export default connect(mapStateToProps, mapDispatchToProps)(ComposeForm);