Commit 657dd1e6 authored by JC Brand's avatar JC Brand

Add /close command for chats

parent 16c83877
......@@ -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({
......
......@@ -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')}`
];
......
......@@ -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')}`,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment