From f5fbf7127505a219c5baee093f4267850b623c9c Mon Sep 17 00:00:00 2001 From: JC Brand Date: Wed, 7 Dec 2016 13:48:47 +0000 Subject: [PATCH] New config setting: muc_disable_moderator_commands --- docs/CHANGES.md | 3 +++ docs/source/configuration.rst | 7 +++++++ src/converse-muc.js | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/docs/CHANGES.md b/docs/CHANGES.md index 7d0baad4f..bebffcb12 100755 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -12,6 +12,9 @@ - Fix empty controlbox toggle after disconnect. [jcbrand] - When inviting someone to a members-only room, first add them to the member list. [jcbrand] +- New configuration setting + [muc_disable_moderator_commands](https://conversejs.org/docs/html/configuration.html#muc_disable_moderator_commands) + [jcbrand] ## 2.0.3 (2016-11-30) - #735 Room configuration button not visible. [jcbrand] diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index decad4e6c..e60de9bf6 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -709,6 +709,13 @@ See also the `storage`_ option, which applies to other cached data, such as which chats you have open, what features the XMPP server supports and what your online status is. +muc_disable_moderator_commands +------------------------------ + +* Default: ``false`` + +Allows you to disable the moderator commands such as ``/kick`` or ``/ban``. + muc_domain ---------- diff --git a/src/converse-muc.js b/src/converse-muc.js index 675d7b61b..524fff535 100755 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -293,6 +293,7 @@ auto_join_rooms: [], auto_list_rooms: false, hide_muc_server: false, + muc_disable_moderator_commands: false, muc_domain: undefined, muc_history_max_stanzas: undefined, muc_instant_rooms: true, @@ -827,6 +828,9 @@ * Parameters: * (String) text - The message text. */ + if (converse.muc_disable_moderator_commands) { + return this.sendChatRoomMessage(text); + } var match = text.replace(/^\s*/, "").match(/^\/(.*?)(?: (.*))?$/) || [false, '', ''], args = match[2] && match[2].splitOnce(' ') || []; switch (match[1]) {