diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt index 7928a3071..20eeab04c 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt @@ -16,7 +16,10 @@ package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive import kotlinx.coroutines.CancellationException import kotlinx.coroutines.cancel -import kotlinx.io.core.* +import kotlinx.io.core.ByteReadPacket +import kotlinx.io.core.discardExact +import kotlinx.io.core.readBytes +import kotlinx.io.core.readUInt import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoId import net.mamoe.mirai.JavaFriendlyAPI @@ -29,7 +32,6 @@ import net.mamoe.mirai.qqandroid.contact.GroupImpl import net.mamoe.mirai.qqandroid.contact.checkIsGroupImpl import net.mamoe.mirai.qqandroid.contact.checkIsInstance import net.mamoe.mirai.qqandroid.contact.checkIsMemberImpl -import net.mamoe.mirai.qqandroid.message.contextualBugReportException import net.mamoe.mirai.qqandroid.network.MultiPacketBySequence import net.mamoe.mirai.qqandroid.network.Packet import net.mamoe.mirai.qqandroid.network.QQAndroidClient @@ -37,10 +39,10 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.jce.MsgInfo import net.mamoe.mirai.qqandroid.network.protocol.data.jce.MsgType0x210 import net.mamoe.mirai.qqandroid.network.protocol.data.jce.OnlinePushPack import net.mamoe.mirai.qqandroid.network.protocol.data.jce.RequestPacket +import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x115 import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x27.SubMsgType0x27.* import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x44 import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0xb3 -import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x115 import net.mamoe.mirai.qqandroid.network.protocol.data.proto.TroopTips0x857 import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket @@ -448,13 +450,15 @@ internal object Transformers528 : Map by mapOf( } else emptySequence() }, //好友输入状态 - 0x115L to lambda528 {bot-> - val body=vProtobuf.loadAs(Submsgtype0x115.SubMsgType0x115.MsgBody.serializer()) + 0x115L to lambda528 { bot -> + val body = vProtobuf.loadAs(Submsgtype0x115.SubMsgType0x115.MsgBody.serializer()) val friend = bot.getFriendOrNull(body.fromUin) val item = body.msgNotifyItem - return@lambda528 if(friend!=null&&item!=null){ - sequenceOf(FriendInputStatusChangedEvent(friend,item.eventType==1)) - } else { emptySequence()} + return@lambda528 if (friend != null && item != null) { + sequenceOf(FriendInputStatusChangedEvent(friend, item.eventType == 1)) + } else { + emptySequence() + } }, // 群相关, ModFriendRemark, DelFriend, ModGroupProfile 0x27L to lambda528 { bot -> diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/friend.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/friend.kt index 049a5d6e4..4e7cf3d11 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/friend.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/friend.kt @@ -21,6 +21,7 @@ import net.mamoe.mirai.contact.User import net.mamoe.mirai.event.AbstractEvent import net.mamoe.mirai.event.internal.MiraiAtomicBoolean import net.mamoe.mirai.qqandroid.network.Packet +import net.mamoe.mirai.utils.SinceMirai import net.mamoe.mirai.utils.internal.runBlocking import kotlin.jvm.* @@ -114,6 +115,7 @@ public data class FriendAvatarChangedEvent internal constructor( /** * 好友输入状态改变的事件,当开始输入文字、退出聊天窗口或清空输入框时会触发此事件 */ +@SinceMirai("1.2.0") public data class FriendInputStatusChangedEvent internal constructor( public override val friend: Friend, public val inputting: Boolean