mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Separated the join instructions into a executeJoinCommand method
This commit is contained in:
parent
f9f49b7640
commit
550b9db4dc
@ -198,15 +198,7 @@ export class RoomViewModel extends ViewModel {
|
||||
}
|
||||
}
|
||||
|
||||
async _processCommand (message) {
|
||||
let msgtype = undefined;
|
||||
const [commandName, ...args] = message.substring(1).split(" ");
|
||||
switch (commandName) {
|
||||
case "me":
|
||||
message = args.join(" ");
|
||||
msgtype = "m.emote";
|
||||
break;
|
||||
case "join":
|
||||
async executeJoinCommand(args) {
|
||||
if (args.length == 1) {
|
||||
let roomName = args[0];
|
||||
try {
|
||||
@ -231,6 +223,18 @@ export class RoomViewModel extends ViewModel {
|
||||
this._timelineError = null;
|
||||
this.emitChange("error");
|
||||
}
|
||||
}
|
||||
|
||||
async _processCommand (message) {
|
||||
let msgtype = undefined;
|
||||
const [commandName, ...args] = message.substring(1).split(" ");
|
||||
switch (commandName) {
|
||||
case "me":
|
||||
message = args.join(" ");
|
||||
msgtype = "m.emote";
|
||||
break;
|
||||
case "join":
|
||||
await this.executeJoinCommand(args);
|
||||
break;
|
||||
case "shrug":
|
||||
message = "¯\\_(ツ)_/¯ " + args.join(" ");
|
||||
|
Loading…
Reference in New Issue
Block a user