diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/MemberImpl.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/MemberImpl.kt index 5f94f3b4d..09fbd9b5f 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/MemberImpl.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/MemberImpl.kt @@ -89,7 +89,9 @@ internal class MemberImpl constructor( override var nameCard: String get() = _nameCard set(newValue) { - group.checkBotPermissionOperator() + if (id != bot.id) { + group.checkBotPermissionOperator() + } if (_nameCard != newValue) { val oldValue = _nameCard _nameCard = newValue diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/MsgType0x210.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/MsgType0x210.kt new file mode 100644 index 000000000..f1e4ab69f --- /dev/null +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/MsgType0x210.kt @@ -0,0 +1,214 @@ +package net.mamoe.mirai.qqandroid.network.protocol.data.jce + +import net.mamoe.mirai.qqandroid.utils.io.serialization.jce.JceId +import kotlinx.serialization.Serializable +import net.mamoe.mirai.qqandroid.utils.io.JceStruct + +@Serializable +internal class AddGroup( + @JceId(0) val dwGroupID: Long? = null, + @JceId(1) val dwSortID: Long? = null, + @JceId(2) val groupName: String? = "" +) : JceStruct + +@Serializable +internal class DelGroup( + @JceId(0) val dwGroupID: Long? = null +) : JceStruct + +@Serializable +internal class FriendGroup( + @JceId(0) val dwFuin: Long? = null, + @JceId(1) val vOldGroupID: List? = null, + @JceId(2) val vNewGroupID: List? = null +) : JceStruct + +@Serializable +internal class GroupSort( + @JceId(0) val dwGroupID: Long? = null, + @JceId(1) val dwSortID: Long? = null +) : JceStruct + +@Serializable +internal class MarketFaceInfo( + @JceId(0) val insertIdx: Long, + @JceId(1) val marketFaceBuff: ByteArray +) : JceStruct + +@Serializable +internal class ModFriendGroup( + @JceId(0) val vMsgFrdGroup: List? = null +) : JceStruct + +@Serializable +internal class ModGroupName( + @JceId(0) val dwGroupID: Long? = null, + @JceId(1) val groupName: String? = "" +) : JceStruct + +@Serializable +internal class ModGroupSort( + @JceId(0) val vMsgGroupSort: List? = null +) : JceStruct + +@Serializable +internal class MsgType0x210( + @JceId(0) val uSubMsgType: Long, + @JceId(1) val stMsgInfo0x2: MsgType0x210SubMsgType0x2? = null, + @JceId(3) val stMsgInfo0xa: MsgType0x210SubMsgType0xa? = null, + @JceId(4) val stMsgInfo0xe: MsgType0x210SubMsgType0xe? = null, + @JceId(5) val stMsgInfo0x13: MsgType0x210SubMsgType0x13? = null, + @JceId(6) val stMsgInfo0x17: MsgType0x210SubMsgType0x17? = null, + @JceId(7) val stMsgInfo0x20: MsgType0x210SubMsgType0x20? = null, + @JceId(8) val stMsgInfo0x1d: MsgType0x210SubMsgType0x1d? = null, + @JceId(9) val stMsgInfo0x24: MsgType0x210SubMsgType0x24? = null, + @JceId(10) val vProtobuf: ByteArray? = null +) : JceStruct + +@Serializable +internal class MsgType0x210SubMsgType0x13( + @JceId(0) val uint32SrcAppId: Long? = null, + @JceId(1) val uint32SrcInstId: Long? = null, + @JceId(2) val uint32DstAppId: Long? = null, + @JceId(3) val uint32DstInstId: Long? = null, + @JceId(4) val uint64DstUin: Long? = null, + @JceId(5) val uint64Sessionid: Long? = null, + @JceId(6) val uint32Size: Long? = null, + @JceId(7) val uint32Index: Long? = null, + @JceId(8) val uint32Type: Long? = null, + @JceId(9) val buf: ByteArray? = null +) : JceStruct + +@Serializable +internal class MsgType0x210SubMsgType0x13_MsgItem( + @JceId(0) val uint32Type: Long? = null, + @JceId(1) val text: ByteArray? = null +) : JceStruct + +@Serializable +internal class MsgType0x210SubMsgType0x17( + @JceId(0) val dwOpType: Long? = null, + @JceId(1) val stAddGroup: AddGroup? = null, + @JceId(2) val stDelGroup: DelGroup? = null, + @JceId(3) val stModGroupName: ModGroupName? = null, + @JceId(4) val stModGroupSort: ModGroupSort? = null, + @JceId(5) val stModFriendGroup: ModFriendGroup? = null +) : JceStruct + +@Serializable +internal class MsgType0x210SubMsgType0x1d( + @JceId(0) val dwOpType: Long? = null, + @JceId(1) val dwUin: Long? = null, + @JceId(2) val dwID: Long? = null, + @JceId(3) val value: String? = "" +) : JceStruct + +@Serializable +internal class MsgType0x210SubMsgType0x2( + @JceId(0) val uSrcAppId: Long? = null, + @JceId(1) val uSrcInstId: Long? = null, + @JceId(2) val uDstAppId: Long? = null, + @JceId(3) val uDstInstId: Long? = null, + @JceId(4) val uDstUin: Long? = null, + @JceId(5) val fileName: ByteArray? = null, + @JceId(6) val fileIndex: ByteArray? = null, + @JceId(7) val fileMd5: ByteArray? = null, + @JceId(8) val fileKey: ByteArray? = null, + @JceId(9) val uServerIp: Long? = null, + @JceId(10) val uServerPort: Long? = null, + @JceId(11) val fileLen: Long? = null, + @JceId(12) val sessionId: Long? = null, + @JceId(13) val originfileMd5: ByteArray? = null, + @JceId(14) val uOriginfiletype: Long? = null, + @JceId(15) val uSeq: Long? = null +) : JceStruct + +@Serializable +internal class MsgType0x210SubMsgType0x20( + @JceId(0) val dwOpType: Long? = null, + @JceId(1) val dwType: Long? = null, + @JceId(2) val dwUin: Long? = null, + @JceId(3) val remaek: String? = "" +) : JceStruct + +@Serializable +internal class MsgType0x210SubMsgType0x24( + @JceId(0) val vPluginNumList: List? = null +) : JceStruct + +@Serializable +internal class MsgType0x210SubMsgType0xa( + @JceId(0) val uSrcAppId: Long? = null, + @JceId(1) val uSrcInstId: Long? = null, + @JceId(2) val uDstAppId: Long? = null, + @JceId(3) val uDstInstId: Long? = null, + @JceId(4) val uDstUin: Long? = null, + @JceId(5) val uType: Long? = null, + @JceId(6) val uServerIp: Long? = null, + @JceId(7) val uServerPort: Long? = null, + @JceId(8) val vUrlNotify: ByteArray? = null, + @JceId(9) val vTokenKey: ByteArray? = null, + @JceId(10) val uFileLen: Long? = null, + @JceId(11) val fileName: ByteArray? = null, + @JceId(12) val vMd5: ByteArray? = null, + @JceId(13) val sessionId: Long? = null, + @JceId(14) val originfileMd5: ByteArray? = null, + @JceId(15) val uOriginfiletype: Long? = null, + @JceId(16) val uSeq: Long? = null +) : JceStruct + +@Serializable +internal class MsgType0x210SubMsgType0xe( + @JceId(0) val uint32SrcAppId: Long? = null, + @JceId(1) val uint32SrcInstId: Long? = null, + @JceId(2) val uint32DstAppId: Long? = null, + @JceId(3) val uint32DstInstId: Long? = null, + @JceId(4) val uint64DstUin: Long? = null, + @JceId(5) val uint64Sessionid: Long? = null, + @JceId(6) val uint32Operate: Long? = null, + @JceId(7) val uint32Seq: Long? = null, + @JceId(8) val uint32Code: Long? = null, + @JceId(9) val msg: String? = "" +) : JceStruct + +@Serializable +internal class PersonInfoChange( + @JceId(0) val type: Byte? = null, + @JceId(1) val vChgField: List? = null +) : JceStruct + +@Serializable +internal class PersonInfoField( + @JceId(0) val uField: Long? = null +) : JceStruct + +@Serializable +internal class PluginNum( + @JceId(0) val dwID: Long? = null, + @JceId(1) val dwNUm: Long? = null, + @JceId(2) val flag: Byte? = null +) : JceStruct + +@Serializable +internal class SlaveMasterMsg( + @JceId(0) val uMsgType: Long? = null, + @JceId(1) val uCmd: Long? = null, + @JceId(2) val uSeq: Long? = null, + @JceId(3) val fromUin: Long? = null, + @JceId(4) val wFromApp: Short? = null, + @JceId(5) val uFromInstId: Long? = null, + @JceId(6) val toUin: Long? = null, + @JceId(7) val wToApp: Short? = null, + @JceId(8) val uToInstId: Long? = null, + @JceId(9) val vOrigMsg: ByteArray? = null, + @JceId(10) val uLastChangeTime: Long? = null, + @JceId(11) val vReserved: ByteArray? = null, + @JceId(12) val vMarketFace: List? = null, + @JceId(13) val uSuperQQBubbleId: Long? = null +) : JceStruct + +@Serializable +internal class Type_1_QQDataTextMsg( + @JceId(0) val msgItem: List? = null +) : JceStruct + diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/USubtype0x27.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/USubtype0x27.kt new file mode 100644 index 000000000..7e8c260d4 --- /dev/null +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/USubtype0x27.kt @@ -0,0 +1,394 @@ +package net.mamoe.mirai.qqandroid.network.protocol.data.proto + +import kotlinx.serialization.protobuf.ProtoId +import kotlinx.serialization.Serializable +import net.mamoe.mirai.qqandroid.utils.io.ProtoBuf +import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY + +@Serializable +class SubMsgType0x27 : ProtoBuf { + @Serializable + class AddGroup( + @ProtoId(1) val groupid: Int = 0, + @ProtoId(2) val sortid: Int = 0, + @ProtoId(3) val groupname: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class AppointmentNotify( + @ProtoId(1) val fromUin: Long = 0L, + @ProtoId(2) val appointId: String = "", + @ProtoId(3) val notifytype: Int = 0, + @ProtoId(4) val tipsContent: String = "", + @ProtoId(5) val unreadCount: Int = 0, + @ProtoId(6) val joinWording: String = "", + @ProtoId(7) val viewWording: String = "", + @ProtoId(8) val sig: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(9) val eventInfo: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(10) val nearbyEventInfo: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(11) val feedEventInfo: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class BinaryMsg( + @ProtoId(1) val opType: Int = 0, + @ProtoId(2) val opValue: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class ChatMatchInfo( + @ProtoId(1) val sig: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(2) val uin: Long = 0L, + @ProtoId(3) val matchUin: Long = 0L, + @ProtoId(4) val tipsWording: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(5) val leftChatTime: Int = 0, + @ProtoId(6) val timeStamp: Long = 0L, + @ProtoId(7) val matchExpiredTime: Int = 0, + @ProtoId(8) val c2cExpiredTime: Int = 0, + @ProtoId(9) val matchCount: Int = 0, + @ProtoId(10) val nick: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class ConfMsgRoamFlag( + @ProtoId(1) val confid: Long = 0L, + @ProtoId(2) val flag: Int = 0, + @ProtoId(3) val timestamp: Long = 0L + ) : ProtoBuf + + @Serializable + class DaRenNotify( + @ProtoId(1) val uin: Long = 0L, + @ProtoId(2) val loginDays: Int = 0, + @ProtoId(3) val days: Int = 0, + @ProtoId(4) val isYestodayLogin: Int = 0, + @ProtoId(5) val isTodayLogin: Int = 0 + ) : ProtoBuf + + @Serializable + class DelFriend( + @ProtoId(1) val uint64Uins: List? = null + ) : ProtoBuf + + @Serializable + class DelGroup( + @ProtoId(1) val groupid: Int = 0 + ) : ProtoBuf + + @Serializable + class FanpaiziNotify( + @ProtoId(1) val fromUin: Long = 0L, + @ProtoId(2) val fromNick: String = "", + @ProtoId(3) val tipsContent: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(4) val sig: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class ForwardBody( + @ProtoId(1) val notifyType: Int = 0, + @ProtoId(2) val opType: Int = 0, + @ProtoId(3) val msgAddGroup: AddGroup? = null, + @ProtoId(4) val msgDelGroup: DelGroup? = null, + @ProtoId(5) val msgModGroupName: ModGroupName? = null, + @ProtoId(6) val msgModGroupSort: ModGroupSort? = null, + @ProtoId(7) val msgModFriendGroup: ModFriendGroup? = null, + @ProtoId(8) val msgModProfile: ModProfile? = null, + @ProtoId(9) val msgModFriendRemark: ModFriendRemark? = null, + @ProtoId(10) val msgModLongNick: ModLongNick? = null, + @ProtoId(11) val msgModCustomFace: ModCustomFace? = null, + @ProtoId(12) val msgModGroupProfile: ModGroupProfile? = null, + @ProtoId(13) val msgModGroupMemberProfile: ModGroupMemberProfile? = null, + @ProtoId(14) val msgDelFriend: DelFriend? = null, + @ProtoId(15) val msgRoamPriv: ModFrdRoamPriv? = null, + @ProtoId(16) val msgGrpMsgRoamFlag: GrpMsgRoamFlag? = null, + @ProtoId(17) val msgConfMsgRoamFlag: ConfMsgRoamFlag? = null, + @ProtoId(18) val msgModRichLongNick: ModLongNick? = null, + @ProtoId(19) val msgBinPkg: BinaryMsg? = null, + @ProtoId(20) val msgModFriendRings: ModSnsGeneralInfo? = null, + @ProtoId(21) val msgModConfProfile: ModConfProfile? = null, + @ProtoId(22) val msgModFriendFlag: SnsUpdateFlag? = null, + @ProtoId(23) val msgAppointmentNotify: AppointmentNotify? = null, + @ProtoId(25) val msgDarenNotify: DaRenNotify? = null, + @ProtoId(26) val msgNewComeinUserNotify: NewComeinUserNotify? = null, + @ProtoId(200) val msgPushSearchDev: PushSearchDev? = null, + @ProtoId(201) val msgPushReportDev: PushReportDev? = null, + @ProtoId(202) val msgQqPayPush: QQPayPush? = null, + @ProtoId(203) val redpointInfo: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(204) val msgHotFriendNotify: HotFriendNotify? = null, + @ProtoId(205) val msgPraiseRankNotify: PraiseRankNotify? = null, + @ProtoId(210) val msgCampusNotify: MQQCampusNotify? = null, + @ProtoId(211) val msgModRichLongNickEx: ModLongNick? = null, + @ProtoId(212) val msgChatMatchInfo: ChatMatchInfo? = null, + @ProtoId(214) val msgFrdCustomOnlineStatusChange: FrdCustomOnlineStatusChange? = null, + @ProtoId(2000) val msgFanpanziNotify: FanpaiziNotify? = null + ) : ProtoBuf + + @Serializable + class FrdCustomOnlineStatusChange( + @ProtoId(1) val uin: Long = 0L + ) : ProtoBuf + + @Serializable + class FriendGroup( + @ProtoId(1) val fuin: Long = 0L, + @ProtoId(2) val uint32OldGroupId: List? = null, + @ProtoId(3) val uint32NewGroupId: List? = null + ) : ProtoBuf + + @Serializable + class FriendRemark( + @ProtoId(1) val type: Int = 0, + @ProtoId(2) val fuin: Long = 0L, + @ProtoId(3) val rmkName: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(4) val groupCode: Long = 0L + ) : ProtoBuf + + @Serializable + class GPS( + @ProtoId(1) val int32Lat: Int = 900000000, + @ProtoId(2) val int32Lon: Int = 900000000, + @ProtoId(3) val int32Alt: Int = -10000000, + @ProtoId(4) val int32Type: Int = 0 + ) : ProtoBuf + + @Serializable + class GroupMemberProfileInfo( + @ProtoId(1) val field: Int = 0, + @ProtoId(2) val value: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class GroupProfileInfo( + @ProtoId(1) val field: Int = 0, + @ProtoId(2) val value: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class GroupSort( + @ProtoId(1) val groupid: Int = 0, + @ProtoId(2) val sortid: Int = 0 + ) : ProtoBuf + + @Serializable + class GrpMsgRoamFlag( + @ProtoId(1) val groupcode: Long = 0L, + @ProtoId(2) val flag: Int = 0, + @ProtoId(3) val timestamp: Long = 0L + ) : ProtoBuf + + @Serializable + class HotFriendNotify( + @ProtoId(1) val dstUin: Long = 0L, + @ProtoId(2) val praiseHotLevel: Int = 0, + @ProtoId(3) val chatHotLevel: Int = 0, + @ProtoId(4) val praiseHotDays: Int = 0, + @ProtoId(5) val chatHotDays: Int = 0, + @ProtoId(6) val closeLevel: Int = 0, + @ProtoId(7) val closeDays: Int = 0, + @ProtoId(8) val praiseFlag: Int = 0, + @ProtoId(9) val chatFlag: Int = 0, + @ProtoId(10) val closeFlag: Int = 0, + @ProtoId(11) val notifyTime: Long = 0L, + @ProtoId(12) val lastPraiseTime: Long = 0L, + @ProtoId(13) val lastChatTime: Long = 0L, + @ProtoId(14) val qzoneHotLevel: Int = 0, + @ProtoId(15) val qzoneHotDays: Int = 0, + @ProtoId(16) val qzoneFlag: Int = 0, + @ProtoId(17) val lastQzoneTime: Long = 0L + ) : ProtoBuf + + @Serializable + class ModConfProfile( + @ProtoId(1) val uin: Long = 0L, + @ProtoId(2) val confUin: Int = 0, + @ProtoId(3) val msgProfileInfos: List? = null + ) : ProtoBuf + + @Serializable + class ModCustomFace( + @ProtoId(1) val type: Int = 0, + @ProtoId(2) val uin: Long = 0L, + @ProtoId(3) val groupCode: Long = 0L, + @ProtoId(4) val cmdUin: Long = 0L + ) : ProtoBuf + + @Serializable + class ModFrdRoamPriv( + @ProtoId(1) val msgRoamPriv: List? = null + ) : ProtoBuf + + @Serializable + class ModFriendGroup( + @ProtoId(1) val msgFrdGroup: List? = null + ) : ProtoBuf + + @Serializable + class ModFriendRemark( + @ProtoId(1) val msgFrdRmk: List? = null + ) : ProtoBuf + + @Serializable + class ModGroupMemberProfile( + @ProtoId(1) val groupUin: Long = 0L, + @ProtoId(2) val uin: Long = 0L, + @ProtoId(3) val msgGroupMemberProfileInfos: List? = null, + @ProtoId(4) val groupCode: Long = 0L + ) : ProtoBuf + + @Serializable + class ModGroupName( + @ProtoId(1) val groupid: Int = 0, + @ProtoId(2) val groupname: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class ModGroupProfile( + @ProtoId(1) val groupUin: Long = 0L, + @ProtoId(2) val msgGroupProfileInfos: List? = null, + @ProtoId(3) val groupCode: Long = 0L, + @ProtoId(4) val cmdUin: Long = 0L + ) : ProtoBuf + + @Serializable + class ModGroupSort( + @ProtoId(1) val msgGroupsort: List? = null + ) : ProtoBuf + + @Serializable + class ModLongNick( + @ProtoId(1) val uin: Long = 0L, + @ProtoId(2) val value: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class ModProfile( + @ProtoId(1) val uin: Long = 0L, + @ProtoId(2) val msgProfileInfos: List? = null + ) : ProtoBuf + + @Serializable + class ModSnsGeneralInfo( + @ProtoId(1) val msgSnsGeneralInfos: List? = null + ) : ProtoBuf + + @Serializable + class MQQCampusNotify( + @ProtoId(1) val fromUin: Long = 0L, + @ProtoId(2) val wording: String = "", + @ProtoId(3) val target: String = "", + @ProtoId(4) val type: Int = 0, + @ProtoId(5) val source: String = "" + ) : ProtoBuf + + @Serializable + class MsgBody( + @ProtoId(1) val msgModInfos: List? = null + ) : ProtoBuf + + @Serializable + class NewComeinUser( + @ProtoId(1) val uin: Long = 0L, + @ProtoId(2) val isFrd: Int = 0, + @ProtoId(3) val remark: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(4) val nick: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class NewComeinUserNotify( + @ProtoId(1) val msgType: Int = 0, + @ProtoId(2) val boolStrongNotify: Boolean = false, + @ProtoId(3) val pushTime: Int = 0, + @ProtoId(4) val msgNewComeinUser: NewComeinUser? = null, + @ProtoId(5) val msgNewGroup: NewGroup? = null, + @ProtoId(6) val msgNewGroupUser: NewGroupUser? = null + ) : ProtoBuf + + @Serializable + class NewGroup( + @ProtoId(1) val groupCode: Long = 0L, + @ProtoId(2) val groupName: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(3) val ownerUin: Long = 0L, + @ProtoId(4) val ownerNick: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(5) val distance: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class NewGroupUser( + @ProtoId(1) val uin: Long = 0L, + @ProtoId(2) val int32Sex: Int = 0, + @ProtoId(3) val int32Age: Int = 0, + @ProtoId(4) val nick: String = "", + @ProtoId(5) val distance: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class OneRoamPriv( + @ProtoId(1) val fuin: Long = 0L, + @ProtoId(2) val privTag: Int = 0, + @ProtoId(3) val privValue: Int = 0 + ) : ProtoBuf + + @Serializable + class PraiseRankNotify( + @ProtoId(11) val isChampion: Int = 0, + @ProtoId(12) val rankNum: Int = 0, + @ProtoId(13) val msg: String = "" + ) : ProtoBuf + + @Serializable + class ProfileInfo( + @ProtoId(1) val field: Int = 0, + @ProtoId(2) val value: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class PushReportDev( + @ProtoId(1) val msgType: Int = 0, + @ProtoId(4) val cookie: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(5) val reportMaxNum: Int = 200, + @ProtoId(6) val sn: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class PushSearchDev( + @ProtoId(1) val msgType: Int = 0, + @ProtoId(2) val msgGpsInfo: GPS? = null, + @ProtoId(3) val devTime: Int = 0, + @ProtoId(4) val pushTime: Int = 0, + @ProtoId(5) val din: Long = 0L, + @ProtoId(6) val data: String = "" + ) : ProtoBuf + + @Serializable + class QQPayPush( + @ProtoId(1) val uin: Long = 0L, + @ProtoId(2) val boolPayOk: Boolean = false + ) : ProtoBuf + + @Serializable + class SnsUpateBuffer( + @ProtoId(1) val uin: Long = 0L, + @ProtoId(2) val code: Long = 0L, + @ProtoId(3) val result: Int = 0, + @ProtoId(400) val msgSnsUpdateItem: List? = null, + @ProtoId(401) val uint32Idlist: List? = null + ) : ProtoBuf + + @Serializable + class SnsUpdateFlag( + @ProtoId(1) val msgUpdateSnsFlag: List? = null + ) : ProtoBuf + + @Serializable + class SnsUpdateItem( + @ProtoId(1) val updateSnsType: Int = 0, + @ProtoId(2) val value: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + class SnsUpdateOneFlag( + @ProtoId(1) val uin: Long = 0L, + @ProtoId(2) val id: Long = 0L, + @ProtoId(3) val flag: Int = 0 + ) : ProtoBuf +} diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt index 430bcd127..9ea63e1ff 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt @@ -35,8 +35,11 @@ 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 import net.mamoe.mirai.qqandroid.network.protocol.packet.buildResponseUniPacket +import net.mamoe.mirai.qqandroid.network.protocol.data.jce.MsgType0x210 +import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.onlinePush0x210.OnlinePush0x210Factory import net.mamoe.mirai.qqandroid.utils.io.JceStruct import net.mamoe.mirai.qqandroid.utils.io.readString +import net.mamoe.mirai.qqandroid.utils.io.serialization.* import net.mamoe.mirai.qqandroid.utils.io.serialization.decodeUniPacket import net.mamoe.mirai.qqandroid.utils.io.serialization.jce.JceId import net.mamoe.mirai.qqandroid.utils.io.serialization.jceRequestSBuffer @@ -394,21 +397,11 @@ internal class OnlinePush { } } } - - /* 528 -> { - val notifyMsgBody = msgInfo.vMsg.loadAs(Oidb0x858.NotifyMsgBody.serializer()) - notifyMsgBody.optMsgRecallReminder?.let { messageRecallReminder -> - return@flatMap messageRecallReminder.recalledMsgList.asSequence().map { - MessageRecallEvent.FriendRecall( - bot, - it.seq.toLong().shl(32) or it.msgRandom.toLong().and(0xffffffff), - it.time, - messageRecallReminder.uin - ) - } - } - return@flatMap sequenceOf() - }*/ +// 528 -> { +// val notifyMsgBody = msgInfo.vMsg.loadAs(MsgType0x210.serializer()) +// OnlinePush0x210Factory.solve() +// return@flatMap sequenceOf() +// } else -> { bot.network.logger.debug { "unknown shtype ${msgInfo.shMsgType.toInt()}" } return@flatMap sequenceOf() diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/onlinePush0x210/OnlinePush0x210Factory.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/onlinePush0x210/OnlinePush0x210Factory.kt new file mode 100644 index 000000000..239865b9f --- /dev/null +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/onlinePush0x210/OnlinePush0x210Factory.kt @@ -0,0 +1,25 @@ +package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.onlinePush0x210 + +import kotlinx.io.core.String +import net.mamoe.mirai.Bot +import net.mamoe.mirai.event.events.MemberCardChangeEvent +import net.mamoe.mirai.qqandroid.utils.io.serialization.loadAs + +internal object OnlinePush0x210Factory { + +// fun solve(msg: MsgType0x210, bot: Bot): Any? = when (msg.uSubMsgType) { +// 0x27L -> { +// val body = msg.vProtobuf?.loadAs(SubMsgType0x27.MsgBody.serializer()) +// if (body?.msgModInfos != null) { +// body.msgModInfos.firstOrNull()?.msgModGroupMemberProfile?.run { +// val member = bot.groups.getOrNull(groupUin)?.getOrNull(uin) +// val new = msgGroupMemberProfileInfos?.firstOrNull() +// if (member != null && new?.value != null) { +// MemberCardChangeEvent(member.nameCard, String(new.value), member, member) +// } +// } +// } else null +// } +// else -> null +// } +} \ No newline at end of file