diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-03-08 06:01:17 +0000 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-05-21 03:16:21 -0500 |
commit | 467170f4a095c5c794ae4d8f46b5d57205590013 (patch) | |
tree | 65e84fd8b36303095aba331726f7b97902bfb8a5 /app/javascript/flavours/glitch | |
parent | b5cb68581b5cc0a1f9f421763e37028775ca448f (diff) |
more local-only options
Diffstat (limited to 'app/javascript/flavours/glitch')
-rw-r--r-- | app/javascript/flavours/glitch/actions/compose.js | 2 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/reducers/compose.js | 10 | ||||
-rw-r--r-- | app/javascript/flavours/glitch/util/initial_state.js | 1 |
3 files changed, 7 insertions, 6 deletions
diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index 2fb97fa17..103d7aefa 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -144,7 +144,7 @@ export function submitCompose(routerHistory) { dispatch(submitComposeRequest()); if (getState().getIn(['compose', 'advanced_options', 'do_not_federate'])) { - status = status + ' 👁️'; + status = status + ' #!'; } api(getState).post('/api/v1/statuses', { status, diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index 8bb1aa642..e9d59e366 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -45,7 +45,7 @@ import { REDRAFT } from 'flavours/glitch/actions/statuses'; import { Map as ImmutableMap, List as ImmutableList, OrderedSet as ImmutableOrderedSet, fromJS } from 'immutable'; import uuid from 'flavours/glitch/util/uuid'; import { privacyPreference } from 'flavours/glitch/util/privacy_preference'; -import { me, defaultContentType, defaultLocal } from 'flavours/glitch/util/initial_state'; +import { me, defaultContentType, defaultLocal, alwaysLoal } from 'flavours/glitch/util/initial_state'; import { overwrite } from 'flavours/glitch/util/js_helpers'; import { unescapeHTML } from 'flavours/glitch/util/html'; import { recoverHashtags } from 'flavours/glitch/util/hashtag'; @@ -59,7 +59,7 @@ const glitchProbability = 1 - 0.0420215528; const initialState = ImmutableMap({ mounted: false, advanced_options: ImmutableMap({ - do_not_federate: defaultLocal, + do_not_federate: defaultLocal || alwaysLocal, threaded_mode: false, }), sensitive: false, @@ -82,7 +82,7 @@ const initialState = ImmutableMap({ suggestion_token: null, suggestions: ImmutableList(), default_advanced_options: ImmutableMap({ - do_not_federate: null, + do_not_federate: alwaysLocal || null, threaded_mode: null, // Do not reset }), default_privacy: 'public', @@ -177,7 +177,7 @@ function continueThread (state, status) { map.set('in_reply_to', status.id); map.update( 'advanced_options', - map => map.merge(new ImmutableMap({ do_not_federate: /👁\ufe0f?\u200b?(?:<\/p>)?$/.test(status.content) })) + map => map.merge(new ImmutableMap({ do_not_federate: /#!\u200b?(?:<\/p>)?$/.test(status.content) })) ); map.set('privacy', status.visibility); map.set('sensitive', false); @@ -331,7 +331,7 @@ export default function compose(state = initialState, action) { map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy'))); map.update( 'advanced_options', - map => map.merge(new ImmutableMap({ do_not_federate: /👁\ufe0f?\u200b?(?:<\/p>)?$/.test(action.status.get('content')) })) + map => map.merge(new ImmutableMap({ do_not_federate: /#!(?:<\/p>)?$/.test(action.status.get('content')) })) ); map.set('focusDate', new Date()); map.set('caretPosition', null); diff --git a/app/javascript/flavours/glitch/util/initial_state.js b/app/javascript/flavours/glitch/util/initial_state.js index 7a60d21b2..ce361051f 100644 --- a/app/javascript/flavours/glitch/util/initial_state.js +++ b/app/javascript/flavours/glitch/util/initial_state.js @@ -21,6 +21,7 @@ export const favouriteModal = getMeta('favourite_modal'); export const deleteModal = getMeta('delete_modal'); export const me = getMeta('me'); export const defaultLocal = getMeta('default_local'); +export const alwaysLocal = getMeta('always_local'); export const searchEnabled = getMeta('search_enabled'); export const maxChars = (initialState && initialState.max_toot_chars) || 500; export const pollLimits = (initialState && initialState.poll_limits); |