Commit 69e8b071 authored by JC Brand's avatar JC Brand

Minor cleanups

parent 12989ab2
...@@ -950,12 +950,16 @@ converse.plugins.add('converse-muc-views', { ...@@ -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', { ...@@ -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'));
} }
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment