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
fcc9e8c3
Commit
fcc9e8c3
authored
May 27, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also allow `@` in moderator commands
parent
be0274f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
spec/muc.js
spec/muc.js
+1
-1
src/converse-muc-views.js
src/converse-muc-views.js
+6
-3
No files found.
spec/muc.js
View file @
fcc9e8c3
...
@@ -3191,7 +3191,7 @@
...
@@ -3191,7 +3191,7 @@
// XXX: Calling onFormSubmitted directly, trying
// XXX: Calling onFormSubmitted directly, trying
// again via triggering Event doesn't work for some weird
// again via triggering Event doesn't work for some weird
// reason.
// reason.
textarea
.
value
=
'
/kick annoying guy You
\'
re annoying
'
;
textarea
.
value
=
'
/kick
@
annoying guy You
\'
re annoying
'
;
view
.
onFormSubmitted
(
new
Event
(
'
submit
'
));
view
.
onFormSubmitted
(
new
Event
(
'
submit
'
));
expect
(
view
.
validateRoleOrAffiliationChangeArgs
.
calls
.
count
()).
toBe
(
2
);
expect
(
view
.
validateRoleOrAffiliationChangeArgs
.
calls
.
count
()).
toBe
(
2
);
...
...
src/converse-muc-views.js
View file @
fcc9e8c3
...
@@ -921,7 +921,10 @@ converse.plugins.add('converse-muc-views', {
...
@@ -921,7 +921,10 @@ converse.plugins.add('converse-muc-views', {
},
},
getNickOrJIDFromCommandArgs
(
args
)
{
getNickOrJIDFromCommandArgs
(
args
)
{
const
[
text
,
references
]
=
this
.
model
.
parseTextForReferences
(
'
@
'
+
args
);
if
(
!
args
.
startsWith
(
'
@
'
))
{
args
=
'
@
'
+
args
;
}
const
[
text
,
references
]
=
this
.
model
.
parseTextForReferences
(
args
);
if
(
!
references
.
length
)
{
if
(
!
references
.
length
)
{
this
.
showErrorMessage
(
__
(
"
Error: couldn't find a groupchat participant based on your arguments
"
));
this
.
showErrorMessage
(
__
(
"
Error: couldn't find a groupchat participant based on your arguments
"
));
return
false
;
return
false
;
...
@@ -944,7 +947,7 @@ converse.plugins.add('converse-muc-views', {
...
@@ -944,7 +947,7 @@ converse.plugins.add('converse-muc-views', {
if
(
!
nick_or_jid
)
{
if
(
!
nick_or_jid
)
{
return
false
;
return
false
;
}
}
const
reason
=
args
.
s
lice
(
nick_or_jid
.
length
)
.
trim
();
const
reason
=
args
.
s
plit
(
nick_or_jid
,
2
)[
1
]
.
trim
();
// We're guaranteed to have an occupant due to getNickOrJIDFromCommandArgs
// We're guaranteed to have an occupant due to getNickOrJIDFromCommandArgs
const
occupant
=
this
.
model
.
getOccupant
(
nick_or_jid
);
const
occupant
=
this
.
model
.
getOccupant
(
nick_or_jid
);
const
attrs
=
{
const
attrs
=
{
...
@@ -981,7 +984,7 @@ converse.plugins.add('converse-muc-views', {
...
@@ -981,7 +984,7 @@ converse.plugins.add('converse-muc-views', {
if
(
!
nick_or_jid
)
{
if
(
!
nick_or_jid
)
{
return
false
;
return
false
;
}
}
const
reason
=
args
.
s
lice
(
nick_or_jid
.
length
)
.
trim
();
const
reason
=
args
.
s
plit
(
nick_or_jid
,
2
)[
1
]
.
trim
();
// We're guaranteed to have an occupant due to getNickOrJIDFromCommandArgs
// We're guaranteed to have an occupant due to getNickOrJIDFromCommandArgs
const
occupant
=
this
.
model
.
getOccupant
(
nick_or_jid
);
const
occupant
=
this
.
model
.
getOccupant
(
nick_or_jid
);
this
.
model
.
setRole
(
occupant
,
role
,
reason
,
undefined
,
this
.
onCommandError
.
bind
(
this
));
this
.
model
.
setRole
(
occupant
,
role
,
reason
,
undefined
,
this
.
onCommandError
.
bind
(
this
));
...
...
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