Format and annotation

This commit is contained in:
sandtechnology 2020-08-18 15:25:39 +08:00
parent 410f371c74
commit 293e4fb06f
2 changed files with 14 additions and 8 deletions

View File

@ -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<Long, Lambda528> 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 ->

View File

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