mirror of
https://github.com/vector-im/element-web.git
synced 2025-12-09 03:11:23 +01:00
Tweak how command aliases are set
This prevents multiple commands of the same name being returned in getCommandList()
This commit is contained in:
parent
b67131f0c8
commit
84a7fc1640
@ -318,7 +318,9 @@ var commands = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// helpful aliases
|
// helpful aliases
|
||||||
commands.j = commands.join;
|
var aliases = {
|
||||||
|
j: "join"
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
/**
|
/**
|
||||||
@ -338,6 +340,9 @@ module.exports = {
|
|||||||
var cmd = bits[1].substring(1).toLowerCase();
|
var cmd = bits[1].substring(1).toLowerCase();
|
||||||
var args = bits[3];
|
var args = bits[3];
|
||||||
if (cmd === "me") return null;
|
if (cmd === "me") return null;
|
||||||
|
if (aliases[cmd]) {
|
||||||
|
cmd = aliases[cmd];
|
||||||
|
}
|
||||||
if (commands[cmd]) {
|
if (commands[cmd]) {
|
||||||
return commands[cmd].run(roomId, args);
|
return commands[cmd].run(roomId, args);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user