Manual takeback command for ops

This commit is contained in:
Noah 2024-12-08 22:55:59 -08:00
parent 9f64c6907b
commit 0e46d6e679
2 changed files with 19 additions and 5 deletions

View File

@ -1116,6 +1116,19 @@ export default {
return;
}
// DEBUGGING: manual takeback admin command.
match = this.message.match(/^\/takeback (\d+)$/i);
if (match) {
let msgID = parseInt(match[1]);
this.client.send({
action: "takeback",
msgID: msgID,
});
this.ChatClient(`Takeback command send for message ID ${msgID}.`);
this.message = "";
return;
}
// DEBUGGING: fake open a broken video to see the error graphic
if (this.message.toLowerCase().indexOf("/debug-broken-video") === 0) {
this.WebRTC.streams["#broken"] = null;
@ -2134,9 +2147,9 @@ export default {
message: "Do you want to take this message back? Doing so will remove this message from everybody's view in the chat room."
}).then(() => {
this.client.send({
action: "takeback",
msgID: msg.msgID,
});
action: "takeback",
msgID: msg.msgID,
});
});
},
removeMessage(msg) {

View File

@ -299,7 +299,8 @@ export default {
<!-- Owner or admin: take back the message -->
<button type="button" v-if="message.username === username || isOp"
class="button is-small px-2 ml-1"
title="Take back this message (delete it for everybody)" @click="takeback()">
title="Take back this message (delete it for everybody)" @click="takeback()"
:data-msgid="message.msgID">
<i class="fa fa-rotate-left has-text-danger"></i>
</button>
@ -483,7 +484,7 @@ export default {
</a>
<a href="#" class="dropdown-item" v-if="message.username === username || isOp"
@click.prevent="takeback()">
@click.prevent="takeback()" :data-msgid="message.msgID">
<i class="fa fa-rotate-left has-text-danger mr-1"></i>
Take back
</a>