Add redation to three dot menu

Issues #51 and #52.
This commit is contained in:
N-Pex 2021-02-08 15:31:09 +01:00
parent 24724453dd
commit 4e2c2e58a8
2 changed files with 25 additions and 0 deletions

View file

@ -16,6 +16,7 @@
v-on:addreaction="addReaction"
v-on:addreply="addReply(selectedEvent)"
v-on:edit="edit(selectedEvent)"
v-on:redact="redact(selectedEvent)"
v-on:download="download(selectedEvent)"
:event="selectedEvent"
:incoming="selectedEvent.getSender() != $matrix.currentUserId"
@ -823,6 +824,16 @@ export default {
this.$refs.messageInput.focus();
},
redact(event) {
this.$matrix.matrixClient.redactEvent(event.getRoomId(), event.getId())
.then(() => {
console.log("Message redacted");
})
.catch(err => {
console.log("Redaction failed: ", err);
})
},
download(event) {
util
.getAttachment(this.$matrix.matrixClient, event)