diff --git a/src/main/kotlin/org/itxtech/mirainative/bridge/MiraiBridge.kt b/src/main/kotlin/org/itxtech/mirainative/bridge/MiraiBridge.kt index 3cad0a7..c2430f2 100644 --- a/src/main/kotlin/org/itxtech/mirainative/bridge/MiraiBridge.kt +++ b/src/main/kotlin/org/itxtech/mirainative/bridge/MiraiBridge.kt @@ -221,8 +221,7 @@ object MiraiBridge { writeShortLVPacket { writeLong(qq.id) writeString(qq.nick) - //TODO: 备注 - writeString("") + writeString(qq.remark) } } }.encodeBase64() diff --git a/src/main/kotlin/org/itxtech/mirainative/manager/CacheManager.kt b/src/main/kotlin/org/itxtech/mirainative/manager/CacheManager.kt index fdb4f0c..b879a58 100644 --- a/src/main/kotlin/org/itxtech/mirainative/manager/CacheManager.kt +++ b/src/main/kotlin/org/itxtech/mirainative/manager/CacheManager.kt @@ -92,7 +92,10 @@ object CacheManager { fun getRecord(name: String) = records[name.replace(".mnrec", "")] fun findUser(id: Long): User? { - val member = MiraiNative.bot.getFriend(id) ?: senders[id] + var member = MiraiNative.bot.getFriend(id) ?: senders[id] + if (member == null) { + member = MiraiNative.bot.strangers[id] + } if (member == null) { MiraiNative.bot.groups.forEach { if (it[id] != null) { diff --git a/src/main/kotlin/org/itxtech/mirainative/manager/EventManager.kt b/src/main/kotlin/org/itxtech/mirainative/manager/EventManager.kt index 46866d1..cbbf6ff 100644 --- a/src/main/kotlin/org/itxtech/mirainative/manager/EventManager.kt +++ b/src/main/kotlin/org/itxtech/mirainative/manager/EventManager.kt @@ -85,6 +85,17 @@ object EventManager { ) } } + subscribeAlways { + launchEvent { + NativeBridge.eventPrivateMessage( + Bridge.PRI_MSG_SUBTYPE_ONLINE_STATE, + CacheManager.cacheMessage(message.source, chain = message), + sender.id, + ChainCodeConverter.chainToCode(message), + 0 + ) + } + } // 权限事件 subscribeAlways {