MemberList change

This commit is contained in:
jiahua.liu 2020-02-09 15:59:58 +08:00
parent f0de474aaa
commit f4810e1f23
2 changed files with 20 additions and 7 deletions

View File

@ -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.message.toMessageChain
import net.mamoe.mirai.qqandroid.message.toRichTextElems
import net.mamoe.mirai.utils.MiraiDebugAPI
import net.mamoe.mirai.utils.MiraiInternalAPI
import net.mamoe.mirai.utils.cryptor.contentToString
import net.mamoe.mirai.utils.currentTimeSeconds
import kotlin.math.absoluteValue
import kotlin.random.Random
@ -33,15 +35,19 @@ internal class MessageSvc {
* 告知要刷新好友消息
*/
internal object PushNotify : IncomingPacketFactory<RequestPushNotify>("MessageSvc.PushNotify") {
@MiraiDebugAPI
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot, sequenceId: Int): RequestPushNotify {
discardExact(4) // don't remove
return decodeUniPacket(RequestPushNotify.serializer())
}
override suspend fun QQAndroidBot.handle(packet: RequestPushNotify, sequenceId: Int): OutgoingPacket? {
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 {
val messages = resp.uinPairMsgs.asSequence().filterNot { it.msg == null }.flatMap { it.msg!!.asSequence() }.mapNotNull {
when (it.msgHead.msgType) {
33 -> {
println("GroupUin" + it.msgHead.fromUin + "新群员" + it.msgHead.authUin + " 出现了[" + it.msgHead.authNick + "] 添加刷新")
null
}
166 -> {
when {
it.msgHead.fromUin == bot.uin -> null

View File

@ -104,9 +104,9 @@ internal class OnlinePush {
val groupUin = content.fromUin
val target = var7
if (this.readByte().toInt() == 1) {
println("" + groupUin + "新增管理员" + target)
println("uin" + groupUin + "新增管理员" + target)
} else {
println("" + groupUin + "减少管理员" + target)
println("uin" + groupUin + "减少管理员" + target)
}
}
}
@ -115,8 +115,9 @@ internal class OnlinePush {
if (readByte().toInt() == 1) {
val target = readUInt().toLong()
val groupUin = content.fromUin
println("" + groupUin + "t掉了" + target)
println("uin" + groupUin + "t掉了" + target)
}
}
}
}
@ -193,6 +194,10 @@ internal class OnlinePush {
}
}
}
4352 -> {
println(msgInfo.contentToString())
println(msgInfo.vMsg.toUHexString())
}
else -> {
println("unknown group internal type $internalType , data: " + this.readBytes().toUHexString() + " ")
}
@ -200,8 +205,6 @@ internal class OnlinePush {
} else if (msgInfo.shMsgType.toInt() == 528) {
val content = msgInfo.vMsg.loadAs(OnlinePushPack.MsgType0x210.serializer())
println(content.contentToString())
} else if (msgInfo.shMsgType.toInt() == 4352) {
println("4352")
} else {
println("unknown shtype ${msgInfo.shMsgType.toInt()}")
}