From 1e53753b5aab2793ad4ea1170e2a4e6257013bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E6=B1=A0?= <98259561+whitechi73@users.noreply.github.com> Date: Thu, 8 Feb 2024 20:17:51 +0800 Subject: [PATCH] `Shamrock`: fix #227 --- .../shamrock/remote/action/handlers/ModifyTroopMemberName.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/ModifyTroopMemberName.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/ModifyTroopMemberName.kt index f698ac7d..62f7e0f9 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/ModifyTroopMemberName.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/ModifyTroopMemberName.kt @@ -2,6 +2,7 @@ package moe.fuqiuluo.shamrock.remote.action.handlers import kotlinx.serialization.json.JsonElement import moe.fuqiuluo.qqinterface.servlet.GroupSvc +import moe.fuqiuluo.qqinterface.servlet.TicketSvc import moe.fuqiuluo.shamrock.remote.action.ActionSession import moe.fuqiuluo.shamrock.remote.action.IActionHandler import moe.fuqiuluo.shamrock.tools.EmptyJsonString @@ -17,7 +18,7 @@ internal object ModifyTroopMemberName: IActionHandler() { } operator fun invoke(groupId: String, userId: String, card: String, echo: JsonElement = EmptyJsonString): String { - if (!GroupSvc.isAdmin(groupId)) { + if (!GroupSvc.isAdmin(groupId) && userId != TicketSvc.getUin()) { return logic("you are not admin", echo) } return if(GroupSvc.modifyGroupMemberCard(groupId.toLong(), userId.toLong(), card))