Commit 8433bd89 authored by Igor Galić's avatar Igor Galić Committed by ThibG

prepend re: to replies to spoiler-text

if spoiler-text doesn't already start with re:, we prepend `re: `
ourselves in replies.

This implements
Following Plemora's example: pleroma/pleroma-fe!318
parent c3ab2973
......@@ -314,8 +314,12 @@ export default function compose(state = initialState, action) {
map.set('idempotencyKey', uuid());
if (action.status.get('spoiler_text').length > 0) {
let spoiler_text = action.status.get('spoiler_text');
if (!spoiler_text.match(/^re[: ]/i)) {
spoiler_text = 're: '.concat(spoiler_text);
map.set('spoiler', true);
map.set('spoiler_text', action.status.get('spoiler_text'));
map.set('spoiler_text', spoiler_text);
} else {
map.set('spoiler', false);
map.set('spoiler_text', '');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment