From cf943fd13aa02f649f36d0db158212a38ccedffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E6=B1=A0?= Date: Thu, 15 Feb 2024 13:18:43 +0800 Subject: [PATCH] =?UTF-8?q?`Shamrock`:=20`at`=E3=83=A1=E3=83=83=E3=82=BB?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E5=84=AA=E5=85=88`name`=E3=83=91=E3=83=A9?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../qqinterface/servlet/msg/MessageMaker.kt | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/msg/MessageMaker.kt b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/msg/MessageMaker.kt index 9e999e4..35cb5c1 100644 --- a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/msg/MessageMaker.kt +++ b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/msg/MessageMaker.kt @@ -670,17 +670,22 @@ internal object MessageMaker { at.atNtUid = "0" } else -> { - val info = GroupSvc.getTroopMemberInfoByUinV2(peerId, qq, true).onFailure { - LogCenter.log("无法获取群成员信息: $qq", Level.ERROR) - }.getOrNull() - if (info != null) { - at.content = "@${ - info.troopnick - .ifNullOrEmpty(info.friendnick) - .ifNullOrEmpty(qq) - }" + val name = data["name"].asStringOrNull + if (name == null) { + val info = GroupSvc.getTroopMemberInfoByUinV2(peerId, qq, true).onFailure { + LogCenter.log("无法获取群成员信息: $qq", Level.ERROR) + }.getOrNull() + if (info != null) { + at.content = "@${ + info.troopnick + .ifNullOrEmpty(info.friendnick) + .ifNullOrEmpty(qq) + }" + } else { + at.content = "@$qq" + } } else { - at.content = "@${data["name"].asStringOrNull.ifNullOrEmpty(qq)}" + at.content = "@$name" } at.atType = MsgConstant.ATTYPEONE at.atNtUid = ContactHelper.getUidByUinAsync(qq.toLong())