Improve inspection performance

This commit is contained in:
Him188 2021-01-29 10:23:18 +08:00
parent b3e77119fb
commit f8d8ffb782

View File

@ -106,7 +106,10 @@ internal object OnlinePushPbPushGroupMsg : IncomingPacketFactory<Packet?>("Onlin
sender = group.newAnonymous(anonymous.anonNick.encodeToString(), anonymous.anonId.encodeToBase64()) sender = group.newAnonymous(anonymous.anonNick.encodeToString(), anonymous.anonId.encodeToBase64())
name = sender.nameCard name = sender.nameCard
} else { // normal member chat } else { // normal member chat
sender = group[msgHead.fromUin] as NormalMemberImpl sender = group[msgHead.fromUin] as NormalMemberImpl? ?: kotlin.run {
bot.network.logger.warning { "Failed to find member ${msgHead.fromUin} in group ${group.id}" }
return null
}
name = findSenderName(extraInfo, msgHead.groupInfo) ?: sender.nameCardOrNick name = findSenderName(extraInfo, msgHead.groupInfo) ?: sender.nameCardOrNick
} }