mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-05 07:30:09 +08:00
Format and annotation
This commit is contained in:
parent
410f371c74
commit
293e4fb06f
@ -16,7 +16,10 @@ package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive
|
|||||||
|
|
||||||
import kotlinx.coroutines.CancellationException
|
import kotlinx.coroutines.CancellationException
|
||||||
import kotlinx.coroutines.cancel
|
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.Serializable
|
||||||
import kotlinx.serialization.protobuf.ProtoId
|
import kotlinx.serialization.protobuf.ProtoId
|
||||||
import net.mamoe.mirai.JavaFriendlyAPI
|
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.checkIsGroupImpl
|
||||||
import net.mamoe.mirai.qqandroid.contact.checkIsInstance
|
import net.mamoe.mirai.qqandroid.contact.checkIsInstance
|
||||||
import net.mamoe.mirai.qqandroid.contact.checkIsMemberImpl
|
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.MultiPacketBySequence
|
||||||
import net.mamoe.mirai.qqandroid.network.Packet
|
import net.mamoe.mirai.qqandroid.network.Packet
|
||||||
import net.mamoe.mirai.qqandroid.network.QQAndroidClient
|
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.MsgType0x210
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.OnlinePushPack
|
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.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.Submsgtype0x27.SubMsgType0x27.*
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.Submsgtype0x44
|
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.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.data.proto.TroopTips0x857
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory
|
import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory
|
||||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
|
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
|
||||||
@ -448,13 +450,15 @@ internal object Transformers528 : Map<Long, Lambda528> by mapOf(
|
|||||||
} else emptySequence()
|
} else emptySequence()
|
||||||
},
|
},
|
||||||
//好友输入状态
|
//好友输入状态
|
||||||
0x115L to lambda528 {bot->
|
0x115L to lambda528 { bot ->
|
||||||
val body=vProtobuf.loadAs(Submsgtype0x115.SubMsgType0x115.MsgBody.serializer())
|
val body = vProtobuf.loadAs(Submsgtype0x115.SubMsgType0x115.MsgBody.serializer())
|
||||||
val friend = bot.getFriendOrNull(body.fromUin)
|
val friend = bot.getFriendOrNull(body.fromUin)
|
||||||
val item = body.msgNotifyItem
|
val item = body.msgNotifyItem
|
||||||
return@lambda528 if(friend!=null&&item!=null){
|
return@lambda528 if (friend != null && item != null) {
|
||||||
sequenceOf(FriendInputStatusChangedEvent(friend,item.eventType==1))
|
sequenceOf(FriendInputStatusChangedEvent(friend, item.eventType == 1))
|
||||||
} else { emptySequence()}
|
} else {
|
||||||
|
emptySequence()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 群相关, ModFriendRemark, DelFriend, ModGroupProfile
|
// 群相关, ModFriendRemark, DelFriend, ModGroupProfile
|
||||||
0x27L to lambda528 { bot ->
|
0x27L to lambda528 { bot ->
|
||||||
|
@ -21,6 +21,7 @@ import net.mamoe.mirai.contact.User
|
|||||||
import net.mamoe.mirai.event.AbstractEvent
|
import net.mamoe.mirai.event.AbstractEvent
|
||||||
import net.mamoe.mirai.event.internal.MiraiAtomicBoolean
|
import net.mamoe.mirai.event.internal.MiraiAtomicBoolean
|
||||||
import net.mamoe.mirai.qqandroid.network.Packet
|
import net.mamoe.mirai.qqandroid.network.Packet
|
||||||
|
import net.mamoe.mirai.utils.SinceMirai
|
||||||
import net.mamoe.mirai.utils.internal.runBlocking
|
import net.mamoe.mirai.utils.internal.runBlocking
|
||||||
import kotlin.jvm.*
|
import kotlin.jvm.*
|
||||||
|
|
||||||
@ -114,6 +115,7 @@ public data class FriendAvatarChangedEvent internal constructor(
|
|||||||
/**
|
/**
|
||||||
* 好友输入状态改变的事件,当开始输入文字、退出聊天窗口或清空输入框时会触发此事件
|
* 好友输入状态改变的事件,当开始输入文字、退出聊天窗口或清空输入框时会触发此事件
|
||||||
*/
|
*/
|
||||||
|
@SinceMirai("1.2.0")
|
||||||
public data class FriendInputStatusChangedEvent internal constructor(
|
public data class FriendInputStatusChangedEvent internal constructor(
|
||||||
public override val friend: Friend,
|
public override val friend: Friend,
|
||||||
public val inputting: Boolean
|
public val inputting: Boolean
|
||||||
|
Loading…
Reference in New Issue
Block a user