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
657dd1e6
Commit
657dd1e6
authored
Nov 15, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add /close command for chats
parent
16c83877
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
spec/chatbox.js
spec/chatbox.js
+2
-1
src/converse-chatview.js
src/converse-chatview.js
+5
-2
src/converse-muc-views.js
src/converse-muc-views.js
+1
-0
No files found.
spec/chatbox.js
View file @
657dd1e6
...
...
@@ -27,9 +27,10 @@
test_utils
.
sendMessage
(
view
,
'
/help
'
);
const
info_messages
=
Array
.
prototype
.
slice
.
call
(
view
.
el
.
querySelectorAll
(
'
.chat-info:not(.chat-date)
'
),
0
);
expect
(
info_messages
.
length
).
toBe
(
3
);
expect
(
info_messages
.
length
).
toBe
(
4
);
expect
(
info_messages
.
pop
().
textContent
).
toBe
(
'
/help: Show this menu
'
);
expect
(
info_messages
.
pop
().
textContent
).
toBe
(
'
/me: Write in the third person
'
);
expect
(
info_messages
.
pop
().
textContent
).
toBe
(
'
/close: Close this chat
'
);
expect
(
info_messages
.
pop
().
textContent
).
toBe
(
'
/clear: Remove messages
'
);
const
msg
=
$msg
({
...
...
src/converse-chatview.js
View file @
657dd1e6
...
...
@@ -754,10 +754,13 @@ converse.plugins.add('converse-chatview', {
if
(
match
[
1
]
===
"
clear
"
)
{
this
.
clearMessages
();
return
true
;
}
else
if
(
match
[
1
]
===
"
help
"
)
{
}
else
if
(
match
[
1
]
===
"
close
"
)
{
this
.
close
();
return
true
;
}
else
if
(
match
[
1
]
===
"
help
"
)
{
const
msgs
=
[
`<strong>/clear</strong>:
${
__
(
'
Remove messages
'
)}
`
,
`<strong>/close</strong>:
${
__
(
'
Close this chat
'
)}
`
,
`<strong>/me</strong>:
${
__
(
'
Write in the third person
'
)}
`
,
`<strong>/help</strong>:
${
__
(
'
Show this menu
'
)}
`
];
...
...
src/converse-muc-views.js
View file @
657dd1e6
...
...
@@ -1328,6 +1328,7 @@ converse.plugins.add('converse-muc-views', {
`<strong>/admin</strong>:
${
__
(
"
Change user's affiliation to admin
"
)}
`
,
`<strong>/ban</strong>:
${
__
(
'
Ban user by changing their affiliation to outcast
'
)}
`
,
`<strong>/clear</strong>:
${
__
(
'
Clear the chat area
'
)}
`
,
`<strong>/close</strong>:
${
__
(
'
Close this groupchat
'
)}
`
,
`<strong>/deop</strong>:
${
__
(
'
Change user role to participant
'
)}
`
,
`<strong>/destroy</strong>:
${
__
(
'
Remove this groupchat
'
)}
`
,
`<strong>/help</strong>:
${
__
(
'
Show this menu
'
)}
`
,
...
...
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