glitch: fix local only matching
parent
f21d4c3209
commit
b5e6e77ca4
|
@ -144,7 +144,9 @@ export function submitCompose(routerHistory) {
|
||||||
|
|
||||||
dispatch(submitComposeRequest());
|
dispatch(submitComposeRequest());
|
||||||
if (getState().getIn(['compose', 'advanced_options', 'do_not_federate'])) {
|
if (getState().getIn(['compose', 'advanced_options', 'do_not_federate'])) {
|
||||||
status = status + ' #!';
|
if (!/(?:#|#|#)(?:!|!|!)(?:<\/p>)?$/.test(status)) {
|
||||||
|
status = status + ' #!';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
api(getState).post('/api/v1/statuses', {
|
api(getState).post('/api/v1/statuses', {
|
||||||
status,
|
status,
|
||||||
|
|
|
@ -177,7 +177,7 @@ function continueThread (state, status) {
|
||||||
map.set('in_reply_to', status.id);
|
map.set('in_reply_to', status.id);
|
||||||
map.update(
|
map.update(
|
||||||
'advanced_options',
|
'advanced_options',
|
||||||
map => map.merge(new ImmutableMap({ do_not_federate: /#!\u200b?(?:<\/p>)?$/.test(status.content) }))
|
map => map.merge(new ImmutableMap({ do_not_federate: /(?:#|#|#)(?:!|!|!)(?:<\/p>)?$/.test(status.content) }))
|
||||||
);
|
);
|
||||||
map.set('privacy', status.visibility);
|
map.set('privacy', status.visibility);
|
||||||
map.set('sensitive', false);
|
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.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy')));
|
||||||
map.update(
|
map.update(
|
||||||
'advanced_options',
|
'advanced_options',
|
||||||
map => map.merge(new ImmutableMap({ do_not_federate: /#!(?:<\/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('focusDate', new Date());
|
||||||
map.set('caretPosition', null);
|
map.set('caretPosition', null);
|
||||||
|
|
Loading…
Reference in New Issue