mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +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) {
|
async executeJoinCommand(args) {
|
||||||
let msgtype = undefined;
|
|
||||||
const [commandName, ...args] = message.substring(1).split(" ");
|
|
||||||
switch (commandName) {
|
|
||||||
case "me":
|
|
||||||
message = args.join(" ");
|
|
||||||
msgtype = "m.emote";
|
|
||||||
break;
|
|
||||||
case "join":
|
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
let roomName = args[0];
|
let roomName = args[0];
|
||||||
try {
|
try {
|
||||||
@ -231,6 +223,18 @@ export class RoomViewModel extends ViewModel {
|
|||||||
this._timelineError = null;
|
this._timelineError = null;
|
||||||
this.emitChange("error");
|
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;
|
break;
|
||||||
case "shrug":
|
case "shrug":
|
||||||
message = "¯\\_(ツ)_/¯ " + args.join(" ");
|
message = "¯\\_(ツ)_/¯ " + args.join(" ");
|
||||||
|
Loading…
Reference in New Issue
Block a user