From 3464bb30f83dcfc8e8096d191fd110d84b9ad42f Mon Sep 17 00:00:00 2001 From: Surinna Curtis Date: Thu, 6 Jul 2017 22:30:21 -0500 Subject: [PATCH] replies to local-only toots default to local-only, and fix some regex bugs --- app/javascript/mastodon/reducers/compose.js | 4 +++- app/services/post_status_service.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js index a83df62dcd..21d801f2a4 100644 --- a/app/javascript/mastodon/reducers/compose.js +++ b/app/javascript/mastodon/reducers/compose.js @@ -180,7 +180,9 @@ export default function compose(state = initialState, action) { map.set('in_reply_to', action.status.get('id')); map.set('text', statusToTextMentions(state, action.status)); map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy'))); - map.set('advanced_options', state.get('default_advanced_options')); + map.set('advanced_options', new Immutable.Map({ + do_not_federate: /👁\ufe0f?<\/p>$/.test(action.status.get('content')), + })); map.set('focusDate', new Date()); map.set('preselectDate', new Date()); map.set('idempotencyKey', uuid()); diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index ae9b63abe4..9fb1a2b12c 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -38,7 +38,7 @@ class PostStatusService < BaseService DistributionWorker.perform_async(status.id) # match both with and without U+FE0F (the emoji variation selector) - unless /[👁👁️]$/.match?(status.content) + unless /👁\ufe0f?\z/.match?(status.content) Pubsubhubbub::DistributionWorker.perform_async(status.stream_entry.id) end