mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Use "args.join" instead of "message.substring"
into RoomViewModel._processCommands
This commit is contained in:
parent
5fa6793958
commit
09fd1a5113
@ -202,7 +202,7 @@ export class RoomViewModel extends ViewModel {
|
|||||||
const [commandName, ...args] = message.substring(1).split(" ");
|
const [commandName, ...args] = message.substring(1).split(" ");
|
||||||
switch (commandName) {
|
switch (commandName) {
|
||||||
case "me":
|
case "me":
|
||||||
message = message.substring(4).trim();
|
message = args.join(" ");
|
||||||
msgtype = "m.emote";
|
msgtype = "m.emote";
|
||||||
break;
|
break;
|
||||||
case "join":
|
case "join":
|
||||||
@ -232,19 +232,19 @@ export class RoomViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "shrug":
|
case "shrug":
|
||||||
message = "¯\\_(ツ)_/¯ " + message.substring(7);
|
message = "¯\\_(ツ)_/¯ " + args.join(" ");
|
||||||
msgtype = "m.text";
|
msgtype = "m.text";
|
||||||
break;
|
break;
|
||||||
case "tableflip":
|
case "tableflip":
|
||||||
message="(╯°□°)╯︵ ┻━┻ " + message.substring(11);
|
message="(╯°□°)╯︵ ┻━┻ " + args.join(" ");
|
||||||
msgtype = "m.text";
|
msgtype = "m.text";
|
||||||
break;
|
break;
|
||||||
case "unflip":
|
case "unflip":
|
||||||
message="┬──┬ ノ( ゜-゜ノ) " + message.substring(8);
|
message="┬──┬ ノ( ゜-゜ノ) " + args.join(" ");
|
||||||
msgtype = "m.text";
|
msgtype = "m.text";
|
||||||
break;
|
break;
|
||||||
case "lenny":
|
case "lenny":
|
||||||
message="( ͡° ͜ʖ ͡°) " + message.substring(7);
|
message="( ͡° ͜ʖ ͡°) " + args.join(" ");
|
||||||
msgtype = "m.text";
|
msgtype = "m.text";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user