mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-24 14:30:09 +08:00
MemberList change
This commit is contained in:
parent
f0de474aaa
commit
f4810e1f23
@ -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
|
||||
|
@ -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()}")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user