Commit f4810e1f authored by jiahua.liu's avatar jiahua.liu

MemberList change

parent f0de474a
...@@ -23,7 +23,9 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.proto.SyncCookie ...@@ -23,7 +23,9 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.proto.SyncCookie
import net.mamoe.mirai.qqandroid.network.protocol.packet.* import net.mamoe.mirai.qqandroid.network.protocol.packet.*
import net.mamoe.mirai.qqandroid.message.toMessageChain import net.mamoe.mirai.qqandroid.message.toMessageChain
import net.mamoe.mirai.qqandroid.message.toRichTextElems import net.mamoe.mirai.qqandroid.message.toRichTextElems
import net.mamoe.mirai.utils.MiraiDebugAPI
import net.mamoe.mirai.utils.MiraiInternalAPI import net.mamoe.mirai.utils.MiraiInternalAPI
import net.mamoe.mirai.utils.cryptor.contentToString
import net.mamoe.mirai.utils.currentTimeSeconds import net.mamoe.mirai.utils.currentTimeSeconds
import kotlin.math.absoluteValue import kotlin.math.absoluteValue
import kotlin.random.Random import kotlin.random.Random
...@@ -33,15 +35,19 @@ internal class MessageSvc { ...@@ -33,15 +35,19 @@ internal class MessageSvc {
* 告知要刷新好友消息 * 告知要刷新好友消息
*/ */
internal object PushNotify : IncomingPacketFactory<RequestPushNotify>("MessageSvc.PushNotify") { internal object PushNotify : IncomingPacketFactory<RequestPushNotify>("MessageSvc.PushNotify") {
@MiraiDebugAPI
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot, sequenceId: Int): RequestPushNotify { override suspend fun ByteReadPacket.decode(bot: QQAndroidBot, sequenceId: Int): RequestPushNotify {
discardExact(4) // don't remove discardExact(4) // don't remove
return decodeUniPacket(RequestPushNotify.serializer()) return decodeUniPacket(RequestPushNotify.serializer())
} }
override suspend fun QQAndroidBot.handle(packet: RequestPushNotify, sequenceId: Int): OutgoingPacket? { override suspend fun QQAndroidBot.handle(packet: RequestPushNotify, sequenceId: Int): OutgoingPacket? {
network.run { network.run {
return PbGetMsg(client, MsgSvc.SyncFlag.START, packet.stMsgInfo?.uMsgTime ?: currentTimeSeconds) return PbGetMsg(
client,
MsgSvc.SyncFlag.START,
packet.stMsgInfo?.uMsgTime ?: currentTimeSeconds
)
} }
} }
} }
...@@ -120,6 +126,10 @@ internal class MessageSvc { ...@@ -120,6 +126,10 @@ internal class MessageSvc {
val messages = resp.uinPairMsgs.asSequence().filterNot { it.msg == null }.flatMap { it.msg!!.asSequence() }.mapNotNull { val messages = resp.uinPairMsgs.asSequence().filterNot { it.msg == null }.flatMap { it.msg!!.asSequence() }.mapNotNull {
when (it.msgHead.msgType) { when (it.msgHead.msgType) {
33 -> {
println("GroupUin" + it.msgHead.fromUin + "新群员" + it.msgHead.authUin + " 出现了[" + it.msgHead.authNick + "] 添加刷新")
null
}
166 -> { 166 -> {
when { when {
it.msgHead.fromUin == bot.uin -> null it.msgHead.fromUin == bot.uin -> null
......
...@@ -104,9 +104,9 @@ internal class OnlinePush { ...@@ -104,9 +104,9 @@ internal class OnlinePush {
val groupUin = content.fromUin val groupUin = content.fromUin
val target = var7 val target = var7
if (this.readByte().toInt() == 1) { if (this.readByte().toInt() == 1) {
println("群" + groupUin + "新增管理员" + target) println("群uin" + groupUin + "新增管理员" + target)
} else { } else {
println("群" + groupUin + "减少管理员" + target) println("群uin" + groupUin + "减少管理员" + target)
} }
} }
} }
...@@ -115,8 +115,9 @@ internal class OnlinePush { ...@@ -115,8 +115,9 @@ internal class OnlinePush {
if (readByte().toInt() == 1) { if (readByte().toInt() == 1) {
val target = readUInt().toLong() val target = readUInt().toLong()
val groupUin = content.fromUin val groupUin = content.fromUin
println("群" + groupUin + "t掉了" + target) println("群uin" + groupUin + "t掉了" + target)
} }
} }
} }
} }
...@@ -193,6 +194,10 @@ internal class OnlinePush { ...@@ -193,6 +194,10 @@ internal class OnlinePush {
} }
} }
} }
4352 -> {
println(msgInfo.contentToString())
println(msgInfo.vMsg.toUHexString())
}
else -> { else -> {
println("unknown group internal type $internalType , data: " + this.readBytes().toUHexString() + " ") println("unknown group internal type $internalType , data: " + this.readBytes().toUHexString() + " ")
} }
...@@ -200,8 +205,6 @@ internal class OnlinePush { ...@@ -200,8 +205,6 @@ internal class OnlinePush {
} else if (msgInfo.shMsgType.toInt() == 528) { } else if (msgInfo.shMsgType.toInt() == 528) {
val content = msgInfo.vMsg.loadAs(OnlinePushPack.MsgType0x210.serializer()) val content = msgInfo.vMsg.loadAs(OnlinePushPack.MsgType0x210.serializer())
println(content.contentToString()) println(content.contentToString())
} else if (msgInfo.shMsgType.toInt() == 4352) {
println("4352")
} else { } else {
println("unknown shtype ${msgInfo.shMsgType.toInt()}") println("unknown shtype ${msgInfo.shMsgType.toInt()}")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment