Commit 17ef50f6 authored by JC Brand's avatar JC Brand

muc-views: admins can also change the MUC subject

parent 161cbec0
......@@ -3009,13 +3009,13 @@
textarea.value = '/help';
view.onKeyDown(enter);
info_messages = sizzle('.chat-info:not(.chat-event)', view.el);
expect(info_messages.length).toBe(17);
expect(info_messages.length).toBe(19);
let commands = info_messages.map(m => m.textContent.replace(/:.*$/, ''));
expect(commands).toEqual([
"You can run the following commands",
"/admin", "/ban", "/clear", "/deop", "/destroy",
"/help", "/kick", "/me", "/member", "/modtools", "/mute", "/nick",
"/op", "/register", "/revoke", "/voice"
"/op", "/register", "/revoke", "/subject", "/topic", "/voice"
]);
occupant.set('affiliation', 'member');
textarea.value = '/clear';
......
......@@ -1374,7 +1374,7 @@ converse.plugins.add('converse-muc-views', {
getAllowedCommands () {
let allowed_commands = ['clear', 'help', 'me', 'nick', 'register'];
if (this.model.config.get('changesubject') || this.model.getOwnAffiliation() === 'owner') {
if (this.model.config.get('changesubject') || ['owner', 'admin'].includes(this.model.getOwnAffiliation())) {
allowed_commands = [...allowed_commands, ...['subject', 'topic']];
}
const occupant = this.model.occupants.findWhere({'jid': _converse.bare_jid});
......
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