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
a1a2b501
Commit
a1a2b501
authored
Feb 21, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modools: Restrict which affiliations and roles can be set
bsaed on `muc_disable_slash_commands`
parent
cd442f27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
src/converse-muc-views.js
src/converse-muc-views.js
+8
-9
No files found.
src/converse-muc-views.js
View file @
a1a2b501
...
...
@@ -1442,7 +1442,12 @@ converse.plugins.add('converse-muc-views', {
allowed_commands
=
allowed_commands
.
concat
(
VISITOR_COMMANDS
);
}
allowed_commands
.
sort
();
return
allowed_commands
;
if
(
Array
.
isArray
(
_converse
.
muc_disable_slash_commands
))
{
return
allowed_commands
.
filter
(
c
=>
!
_converse
.
muc_disable_slash_commands
.
includes
(
c
));
}
else
{
return
allowed_commands
;
}
},
parseMessageForCommands
(
text
)
{
...
...
@@ -1455,14 +1460,8 @@ converse.plugins.add('converse-muc-views', {
return
false
;
}
const
args
=
text
.
slice
((
'
/
'
+
command
).
length
+
1
).
trim
();
let
disabled_commands
=
[];
if
(
Array
.
isArray
(
_converse
.
muc_disable_slash_commands
))
{
disabled_commands
=
_converse
.
muc_disable_slash_commands
;
if
(
disabled_commands
.
includes
(
command
))
{
return
false
;
}
}
const
disabled_commands
=
Array
.
isArray
(
_converse
.
muc_disable_slash_commands
)
?
_converse
.
muc_disable_slash_commands
:
[];
const
allowed_commands
=
this
.
getAllowedCommands
();
if
(
!
allowed_commands
.
includes
(
command
))
{
return
false
;
...
...
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