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
3d3d97e7
Commit
3d3d97e7
authored
Jan 16, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restrict /topic command to allowed users
parent
aa86a8be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
docs/source/session.rst
docs/source/session.rst
+1
-1
src/converse-muc-views.js
src/converse-muc-views.js
+5
-5
No files found.
docs/source/session.rst
View file @
3d3d97e7
...
...
@@ -154,7 +154,7 @@ URL from which Converse should fetch the username and token.
Keeping users logged-in across page reloads
===========================================
If you'
r
e properly set up :ref:`shared session support <session-support>`, then
If you'
v
e properly set up :ref:`shared session support <session-support>`, then
your users will stay logged-in to the XMPP server upon page reloads.
However, if users are logging in manually, then users might get logged out between requests.
...
...
src/converse-muc-views.js
View file @
3d3d97e7
...
...
@@ -1373,11 +1373,10 @@ converse.plugins.add('converse-muc-views', {
},
getAllowedCommands
()
{
// FIXME: The availability of some of these commands
// depend on the MUCs configuration (e.g. whether it's
// moderated or not). We need to take that into
// consideration.
let
allowed_commands
=
[
'
clear
'
,
'
help
'
,
'
me
'
,
'
nick
'
,
'
subject
'
,
'
topic
'
,
'
register
'
];
let
allowed_commands
=
[
'
clear
'
,
'
help
'
,
'
me
'
,
'
nick
'
,
'
register
'
];
if
(
this
.
model
.
config
.
get
(
'
changesubject
'
)
||
this
.
model
.
getOwnAffiliation
()
===
'
owner
'
)
{
allowed_commands
=
[...
allowed_commands
,
...[
'
subject
'
,
'
topic
'
]];
}
const
occupant
=
this
.
model
.
occupants
.
findWhere
({
'
jid
'
:
_converse
.
bare_jid
});
if
(
this
.
verifyAffiliations
([
'
owner
'
],
occupant
,
false
))
{
allowed_commands
=
allowed_commands
.
concat
(
OWNER_COMMANDS
).
concat
(
ADMIN_COMMANDS
);
...
...
@@ -1389,6 +1388,7 @@ converse.plugins.add('converse-muc-views', {
}
else
if
(
!
this
.
verifyRoles
([
'
visitor
'
,
'
participant
'
,
'
moderator
'
],
occupant
,
false
))
{
allowed_commands
=
allowed_commands
.
concat
(
VISITOR_COMMANDS
);
}
allowed_commands
.
sort
();
return
allowed_commands
;
},
...
...
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