From e70b439cddf740924adf3cfe68b9fc94baca2770 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Fri, 10 May 2024 21:32:32 -0700 Subject: [PATCH] Admin command buttons in the profile modal --- src/App.vue | 32 +++++++++++++--- src/components/ProfileModal.vue | 65 ++++++++++++++++++++++++++++++++- 2 files changed, 90 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index f938f54..cd2b1a3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -653,7 +653,7 @@ export default { }, isOp() { // Returns if the current user has operator rights - return this.jwt.claims.op; + return this.jwt.claims.op || this.whoMap[this.username].op; }, isVIP() { // Returns if the current user has VIP rights. @@ -933,6 +933,14 @@ export default { this.messageBox.selectionStart = this.messageBox.selectionEnd = this.messageBox.value.length; }); }, + sendCommand(message) { + // Automatically send a message to the chat server. + // e.g. for the ProfileModal to send a "/kick username" command for easy operator buttons. + let origMsg = this.message; + this.message = message; + this.sendMessage(); + this.message = origMsg; + }, sendMessage() { if (!this.message) { return; @@ -4064,11 +4072,23 @@ export default { :message="reportModal.message" @accept="doReport" @cancel="reportModal.visible = false"> - +
diff --git a/src/components/ProfileModal.vue b/src/components/ProfileModal.vue index f1d3062..f3d166f 100644 --- a/src/components/ProfileModal.vue +++ b/src/components/ProfileModal.vue @@ -1,10 +1,13 @@