Commit ccb8662e authored by JC Brand's avatar JC Brand

Bugfix. First match for MUC commands

parent 8ccf1da9
# Changelog # Changelog
## 4.0.6 (unreleased) ## 4.0.7 (Unreleased)
- Bugfix: MUC commands were being ignored
## 4.0.6 (2018-12-07)
- Updated translations: ar, cs, de, es, eu, fr, gl, hu, id, it, ja, nb, pt_BR - Updated translations: ar, cs, de, es, eu, fr, gl, hu, id, it, ja, nb, pt_BR
- Don't render http (i.e. non-TLS) resources - Don't render http (i.e. non-TLS) resources
......
...@@ -54300,12 +54300,8 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins ...@@ -54300,12 +54300,8 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins
}, },
parseMessageForCommands(text) { parseMessageForCommands(text) {
if (_converse.ChatBoxView.prototype.parseMessageForCommands.apply(this, arguments)) {
return true;
}
if (_converse.muc_disable_moderator_commands) { if (_converse.muc_disable_moderator_commands) {
return false; return _converse.ChatBoxView.prototype.parseMessageForCommands.apply(this, arguments);
} }
const match = text.replace(/^\s*/, "").match(/^\/(.*?)(?: (.*))?$/) || [false, '', ''], const match = text.replace(/^\s*/, "").match(/^\/(.*?)(?: (.*))?$/) || [false, '', ''],
...@@ -54463,7 +54459,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins ...@@ -54463,7 +54459,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins
break; break;
default: default:
return false; return _converse.ChatBoxView.prototype.parseMessageForCommands.apply(this, arguments);
} }
return true; return true;
...@@ -859,11 +859,8 @@ converse.plugins.add('converse-muc-views', { ...@@ -859,11 +859,8 @@ converse.plugins.add('converse-muc-views', {
}, },
parseMessageForCommands (text) { parseMessageForCommands (text) {
if (_converse.ChatBoxView.prototype.parseMessageForCommands.apply(this, arguments)) {
return true;
}
if (_converse.muc_disable_moderator_commands) { if (_converse.muc_disable_moderator_commands) {
return false; return _converse.ChatBoxView.prototype.parseMessageForCommands.apply(this, arguments);
} }
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) || [],
...@@ -1026,7 +1023,7 @@ converse.plugins.add('converse-muc-views', { ...@@ -1026,7 +1023,7 @@ converse.plugins.add('converse-muc-views', {
undefined, this.onCommandError.bind(this)); undefined, this.onCommandError.bind(this));
break; break;
default: default:
return false; return _converse.ChatBoxView.prototype.parseMessageForCommands.apply(this, arguments);
} }
return true; return true;
}, },
......
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