Shamrock: atメッセージ優先nameパラメータ

This commit is contained in:
白池 2024-02-15 13:18:43 +08:00
parent 9608b46799
commit cf943fd13a

View File

@ -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())