mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Add roomavatar slash command to set avatar of the current room
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
e18b38c409
commit
2632e648b4
1 changed files with 18 additions and 0 deletions
|
@ -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(this.props.roomId, 'm.room.avatar', {url}, '');
|
||||
}));
|
||||
},
|
||||
category: CommandCategories.actions,
|
||||
}),
|
||||
|
||||
myroomavatar: new Command({
|
||||
name: 'myroomavatar',
|
||||
args: '[<mxc_url>]',
|
||||
|
|
Loading…
Reference in a new issue