Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
Shamrock: fix #227
Browse files Browse the repository at this point in the history
  • Loading branch information
whitechi73 committed Feb 8, 2024
1 parent e727877 commit 1e53753
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down

0 comments on commit 1e53753

Please sign in to comment.