From 40378d2b79146521d474d5e087d2775f8e20119c Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Mon, 4 May 2020 12:41:06 -0400 Subject: [PATCH] chat: require and remove leading space for /me Closes #2834. Previously, starting a message with '/me' removed itself, retaining the space between it and the message itself; it also allowed "/memessages" to be processed as /me messages. --- pkg/interface/chat/src/js/components/lib/chat-input.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/interface/chat/src/js/components/lib/chat-input.js b/pkg/interface/chat/src/js/components/lib/chat-input.js index 5cf4036b7..014f10594 100644 --- a/pkg/interface/chat/src/js/components/lib/chat-input.js +++ b/pkg/interface/chat/src/js/components/lib/chat-input.js @@ -151,8 +151,8 @@ export class ChatInput extends Component { } getLetterType(letter) { - if (letter.startsWith('/me')) { - letter = letter.slice(3); + if (letter.startsWith('/me ')) { + letter = letter.slice(4); // remove insignificant leading whitespace. // aces might be relevant to style. while (letter[0] === '\n') {