Minor cleanups
This commit is contained in:
parent
12989ab241
commit
69e8b071d8
@ -950,12 +950,16 @@ converse.plugins.add('converse-muc-views', {
|
|||||||
}
|
}
|
||||||
const match = text.replace(/^\s*/, "").match(/^\/(.*?)(?: (.*))?$/) || [false, '', ''],
|
const match = text.replace(/^\s*/, "").match(/^\/(.*?)(?: (.*))?$/) || [false, '', ''],
|
||||||
args = match[2] && match[2].splitOnce(' ').filter(s => s) || [],
|
args = match[2] && match[2].splitOnce(' ').filter(s => s) || [],
|
||||||
command = match[1].toLowerCase(),
|
command = match[1].toLowerCase();
|
||||||
disabled_commands = Array.isArray(_converse.muc_disable_slash_commands) ?
|
|
||||||
_converse.muc_disable_slash_commands : [];
|
let disabled_commands = [];
|
||||||
if (_.includes(disabled_commands, command)) {
|
if (Array.isArray(_converse.muc_disable_slash_commands)) {
|
||||||
return false;
|
disabled_commands = _converse.muc_disable_slash_commands;
|
||||||
|
if (disabled_commands.includes(command)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (command) {
|
switch (command) {
|
||||||
case 'admin': {
|
case 'admin': {
|
||||||
if (!this.verifyAffiliations(['owner']) || !this.validateRoleChangeCommand(command, args)) {
|
if (!this.verifyAffiliations(['owner']) || !this.validateRoleChangeCommand(command, args)) {
|
||||||
@ -1339,7 +1343,7 @@ converse.plugins.add('converse-muc-views', {
|
|||||||
hideChatRoomContents () {
|
hideChatRoomContents () {
|
||||||
const container_el = this.el.querySelector('.chatroom-body');
|
const container_el = this.el.querySelector('.chatroom-body');
|
||||||
if (!_.isNull(container_el)) {
|
if (!_.isNull(container_el)) {
|
||||||
_.each(container_el.children, (child) => { child.classList.add('hidden'); });
|
[].forEach.call(container_el.children, child => child.classList.add('hidden'));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user