From 09fd1a5113963079a6fe2f30d225af3bd3736bc0 Mon Sep 17 00:00:00 2001 From: Kaki In <91763754+Kaki-In@users.noreply.github.com> Date: Tue, 26 Jul 2022 10:37:05 +0200 Subject: [PATCH] Use "args.join" instead of "message.substring" into RoomViewModel._processCommands --- src/domain/session/room/RoomViewModel.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/domain/session/room/RoomViewModel.js b/src/domain/session/room/RoomViewModel.js index 9b6aa966..a1939f75 100644 --- a/src/domain/session/room/RoomViewModel.js +++ b/src/domain/session/room/RoomViewModel.js @@ -202,7 +202,7 @@ export class RoomViewModel extends ViewModel { const [commandName, ...args] = message.substring(1).split(" "); switch (commandName) { case "me": - message = message.substring(4).trim(); + message = args.join(" "); msgtype = "m.emote"; break; case "join": @@ -232,19 +232,19 @@ export class RoomViewModel extends ViewModel { } break; case "shrug": - message = "¯\\_(ツ)_/¯ " + message.substring(7); + message = "¯\\_(ツ)_/¯ " + args.join(" "); msgtype = "m.text"; break; case "tableflip": - message="(╯°□°)╯︵ ┻━┻ " + message.substring(11); + message="(╯°□°)╯︵ ┻━┻ " + args.join(" "); msgtype = "m.text"; break; case "unflip": - message="┬──┬ ノ( ゜-゜ノ) " + message.substring(8); + message="┬──┬ ノ( ゜-゜ノ) " + args.join(" "); msgtype = "m.text"; break; case "lenny": - message="( ͡° ͜ʖ ͡°) " + message.substring(7); + message="( ͡° ͜ʖ ͡°) " + args.join(" "); msgtype = "m.text"; break; default: