Merge pull request #3460 from matrix-org/t3chguy/room_avatar

Add roomavatar slash command to set avatar of the current room
pull/21833/head
Michael Telatynski 2019-09-19 16:01:35 +01:00 committed by GitHub
commit 46e0a7cafa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View File

@ -259,6 +259,24 @@ export const CommandMap = {
category: CommandCategories.actions,
}),
roomavatar: new Command({
name: 'roomavatar',
args: '[<mxc_url>]',
description: _td('Changes the avatar of the current room'),
runFn: function(roomId, args) {
let promise = Promise.resolve(args);
if (!args) {
promise = singleMxcUpload();
}
return success(promise.then((url) => {
if (!url) return;
return MatrixClientPeg.get().sendStateEvent(roomId, 'm.room.avatar', {url}, '');
}));
},
category: CommandCategories.actions,
}),
myroomavatar: new Command({
name: 'myroomavatar',
args: '[<mxc_url>]',

View File

@ -156,6 +156,7 @@
"Upgrade": "Upgrade",
"Changes your display nickname": "Changes your display nickname",
"Changes your display nickname in the current room only": "Changes your display nickname in the current room only",
"Changes the avatar of the current room": "Changes the avatar of the current room",
"Changes your avatar in this current room only": "Changes your avatar in this current room only",
"Changes your avatar in all rooms": "Changes your avatar in all rooms",
"Gets or sets the room topic": "Gets or sets the room topic",