Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
84be0fb9
Commit
84be0fb9
authored
Jan 12, 2019
by
Christoph Scholz
Committed by
JC Brand
Jan 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new config option "roomconfig_whitelist"
parent
a2f42d27
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
2 deletions
+34
-2
CHANGES.md
CHANGES.md
+4
-0
dist/converse.js
dist/converse.js
+6
-1
docs/source/configuration.rst
docs/source/configuration.rst
+17
-0
src/converse-muc-views.js
src/converse-muc-views.js
+7
-1
No files found.
CHANGES.md
View file @
84be0fb9
# Changelog
## 4.1.1 (unreleased)
-
#1408 new config option
`roomconfig_whitelist`
## 4.1.0 (2019-01-11)
-
Bugfix: MUC commands were being ignored
...
...
dist/converse.js
View file @
84be0fb9
...
...
@@ -53521,6 +53521,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins
_converse.api.settings.update({
'auto_list_rooms': false,
'muc_disable_moderator_commands': false,
'roomconfig_whitelist': [],
'visible_toolbar_buttons': {
'toggle_occupants': true
}
...
...
@@ -54608,7 +54609,11 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins
fieldset_el.insertAdjacentHTML('beforeend', `<p class="form-help">${instructions}</p>`);
}
_.each(fields, field => fieldset_el.insertAdjacentHTML('beforeend', u.xForm2webForm(field, stanza))); // Render save/cancel buttons
_.each(fields, field => {
if (_converse.roomconfig_whitelist.length === 0 || _.includes(_converse.roomconfig_whitelist, field.getAttribute('var'))) {
fieldset_el.insertAdjacentHTML('beforeend', u.xForm2webForm(field, stanza));
}
}); // Render save/cancel buttons
const last_fieldset_el = document.createElement('fieldset');
docs/source/configuration.rst
View file @
84be0fb9
...
...
@@ -1169,6 +1169,23 @@ For example:
}]
});
.. _`roomconfig_whitelist`:
roomconfig_whitelist
--------------------
* Default: ``[]``
A list of room config-option names. If this list is non-empty, only the corresponding room
config-options will be shown in the room configuration form. The default will show all options.
In the following example the user can only see (and thus change) the roomname and nothing else:
.. code-block:: javascript
roomconfig_whitelist: ['muc#roomconfig_roomname'],
root
----
...
...
src/converse-muc-views.js
View file @
84be0fb9
...
...
@@ -100,6 +100,7 @@ converse.plugins.add('converse-muc-views', {
_converse
.
api
.
settings
.
update
({
'
auto_list_rooms
'
:
false
,
'
muc_disable_moderator_commands
'
:
false
,
'
roomconfig_whitelist
'
:
[],
'
visible_toolbar_buttons
'
:
{
'
toggle_occupants
'
:
true
}
...
...
@@ -1115,7 +1116,12 @@ converse.plugins.add('converse-muc-views', {
if
(
instructions
&&
instructions
!==
title
)
{
fieldset_el
.
insertAdjacentHTML
(
'
beforeend
'
,
`<p class="form-help">
${
instructions
}
</p>`
);
}
_
.
each
(
fields
,
field
=>
fieldset_el
.
insertAdjacentHTML
(
'
beforeend
'
,
u
.
xForm2webForm
(
field
,
stanza
)));
_
.
each
(
fields
,
field
=>
{
if
(
_converse
.
roomconfig_whitelist
.
length
===
0
||
_
.
includes
(
_converse
.
roomconfig_whitelist
,
field
.
getAttribute
(
'
var
'
)))
{
fieldset_el
.
insertAdjacentHTML
(
'
beforeend
'
,
u
.
xForm2webForm
(
field
,
stanza
));
}
});
// Render save/cancel buttons
const
last_fieldset_el
=
document
.
createElement
(
'
fieldset
'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment