only allow edits of certain message types
This commit is contained in:
parent
4ecc6ba2fe
commit
cb4f85df0f
1 changed files with 2 additions and 2 deletions
|
@ -71,7 +71,7 @@ class Message extends SnowFlake {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
const editTypes = new Set([0, 19]);
|
||||||
Message.contextmenu.addButton(
|
Message.contextmenu.addButton(
|
||||||
() => I18n.getTranslation("message.edit"),
|
() => I18n.getTranslation("message.edit"),
|
||||||
function (this: Message) {
|
function (this: Message) {
|
||||||
|
@ -79,7 +79,7 @@ class Message extends SnowFlake {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
visable: function () {
|
visable: function () {
|
||||||
return this.author.id === this.localuser.user.id;
|
return this.author.id === this.localuser.user.id && editTypes.has(this.type);
|
||||||
},
|
},
|
||||||
|
|
||||||
icon: {
|
icon: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue