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" at.atNtUid = "0"
} }
else -> { else -> {
val info = GroupSvc.getTroopMemberInfoByUinV2(peerId, qq, true).onFailure { val name = data["name"].asStringOrNull
LogCenter.log("无法获取群成员信息: $qq", Level.ERROR) if (name == null) {
}.getOrNull() val info = GroupSvc.getTroopMemberInfoByUinV2(peerId, qq, true).onFailure {
if (info != null) { LogCenter.log("无法获取群成员信息: $qq", Level.ERROR)
at.content = "@${ }.getOrNull()
info.troopnick if (info != null) {
.ifNullOrEmpty(info.friendnick) at.content = "@${
.ifNullOrEmpty(qq) info.troopnick
}" .ifNullOrEmpty(info.friendnick)
.ifNullOrEmpty(qq)
}"
} else {
at.content = "@$qq"
}
} else { } else {
at.content = "@${data["name"].asStringOrNull.ifNullOrEmpty(qq)}" at.content = "@$name"
} }
at.atType = MsgConstant.ATTYPEONE at.atType = MsgConstant.ATTYPEONE
at.atNtUid = ContactHelper.getUidByUinAsync(qq.toLong()) at.atNtUid = ContactHelper.getUidByUinAsync(qq.toLong())