diff --git a/Gemfile.lock b/Gemfile.lock index aa9f59da8..cc7751ae1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,6 +1,6 @@ GIT remote: https://github.com/rails/rails.git - revision: ecb394a31420f6fd1d0ab692c79f2dd44176e2c9 + revision: c7a716aa5a692cae301d56b345faa5d79cbfc320 branch: 5-0-stable specs: actioncable (5.0.0.1) @@ -110,7 +110,7 @@ GEM coffee-script-source (1.10.0) colorize (0.8.1) concurrent-ruby (1.0.2) - connection_pool (2.2.0) + connection_pool (2.2.1) crack (0.4.3) safe_yaml (~> 1.0.0) debug_inspector (0.0.2) @@ -287,7 +287,7 @@ GEM execjs railties (>= 3.2) tilt - redis (3.3.1) + redis (3.3.2) redis-actionpack (5.0.0) actionpack (>= 4.0.0, < 6) redis-rack (~> 2.0.0.pre) @@ -348,10 +348,10 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) - sidekiq (4.2.1) + sidekiq (4.2.7) concurrent-ruby (~> 1.0) connection_pool (~> 2.2, >= 2.2.0) - rack-protection (~> 1.5) + rack-protection (>= 1.5.0) redis (~> 3.2, >= 3.2.1) simple_form (3.2.1) actionpack (> 4, < 5.1) @@ -374,7 +374,7 @@ GEM tins (~> 1.0) terminal-table (1.7.0) unicode-display_width (~> 1.1) - thor (0.19.1) + thor (0.19.4) thread (0.2.2) thread_safe (0.3.5) tilt (2.0.5) diff --git a/app/assets/javascripts/components/actions/compose.jsx b/app/assets/javascripts/components/actions/compose.jsx index b97cb7b12..c2a7909f6 100644 --- a/app/assets/javascripts/components/actions/compose.jsx +++ b/app/assets/javascripts/components/actions/compose.jsx @@ -23,6 +23,7 @@ export const COMPOSE_MOUNT = 'COMPOSE_MOUNT'; export const COMPOSE_UNMOUNT = 'COMPOSE_UNMOUNT'; export const COMPOSE_SENSITIVITY_CHANGE = 'COMPOSE_SENSITIVITY_CHANGE'; +export const COMPOSE_VISIBILITY_CHANGE = 'COMPOSE_VISIBILITY_CHANGE'; export function changeCompose(text) { return { @@ -65,7 +66,8 @@ export function submitCompose() { status: getState().getIn(['compose', 'text'], ''), in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null), media_ids: getState().getIn(['compose', 'media_attachments']).map(item => item.get('id')), - sensitive: getState().getIn(['compose', 'sensitive']) + sensitive: getState().getIn(['compose', 'sensitive']), + unlisted: getState().getIn(['compose', 'unlisted']) }).then(function (response) { dispatch(submitComposeSuccess(response.data)); dispatch(updateTimeline('home', response.data)); @@ -207,3 +209,10 @@ export function changeComposeSensitivity(checked) { checked }; }; + +export function changeComposeVisibility(checked) { + return { + type: COMPOSE_VISIBILITY_CHANGE, + checked + }; +}; diff --git a/app/assets/javascripts/components/features/compose/components/compose_form.jsx b/app/assets/javascripts/components/features/compose/components/compose_form.jsx index b16731c05..4688f39d3 100644 --- a/app/assets/javascripts/components/features/compose/components/compose_form.jsx +++ b/app/assets/javascripts/components/features/compose/components/compose_form.jsx @@ -70,6 +70,7 @@ const ComposeForm = React.createClass({ suggestion_token: React.PropTypes.string, suggestions: React.PropTypes.array, sensitive: React.PropTypes.bool, + unlisted: React.PropTypes.bool, is_submitting: React.PropTypes.bool, is_uploading: React.PropTypes.bool, in_reply_to: ImmutablePropTypes.map, @@ -79,7 +80,8 @@ const ComposeForm = React.createClass({ onClearSuggestions: React.PropTypes.func.isRequired, onFetchSuggestions: React.PropTypes.func.isRequired, onSuggestionSelected: React.PropTypes.func.isRequired, - onChangeSensitivity: React.PropTypes.func.isRequired + onChangeSensitivity: React.PropTypes.func.isRequired, + onChangeVisibility: React.PropTypes.func.isRequired }, mixins: [PureRenderMixin], @@ -147,6 +149,10 @@ const ComposeForm = React.createClass({ this.props.onChangeSensitivity(e.target.checked); }, + handleChangeVisibility (e) { + this.props.onChangeVisibility(e.target.checked); + }, + render () { const { intl } = this.props; let replyArea = ''; @@ -187,7 +193,12 @@ const ComposeForm = React.createClass({ -