diff --git a/app/src/main/java/moe/fuqiuluo/entries/GroupRecallMessage.kt b/app/src/main/java/moe/fuqiuluo/entries/GroupRecallMessage.kt index a329b69..db6ac43 100644 --- a/app/src/main/java/moe/fuqiuluo/entries/GroupRecallMessage.kt +++ b/app/src/main/java/moe/fuqiuluo/entries/GroupRecallMessage.kt @@ -24,7 +24,8 @@ data class C2cRecallMsgInfo( @Serializable data class GroupRecallMessage( - @ProtoNumber(4) val peerId: Long, + @ProtoNumber(1) val type: UInt, + @ProtoNumber(4) val peerId: UInt, @ProtoNumber(11) val operation: GroupRecallOperation, ) diff --git a/app/src/main/java/moe/fuqiuluo/entries/MessagePush.kt b/app/src/main/java/moe/fuqiuluo/entries/MessagePush.kt index 0b21d03..fdff84f 100644 --- a/app/src/main/java/moe/fuqiuluo/entries/MessagePush.kt +++ b/app/src/main/java/moe/fuqiuluo/entries/MessagePush.kt @@ -20,7 +20,7 @@ data class Message( @Serializable data class MessageHead( - @ProtoNumber(1) val peerId: ULong = ULong.MIN_VALUE, + @ProtoNumber(1) val peerId: UInt = UInt.MIN_VALUE, @ProtoNumber(2) val peerUid: String? = null, @ProtoNumber(5) val targetId: Long = Long.MIN_VALUE, @ProtoNumber(6) val targetUid: String? = null diff --git a/app/src/main/java/moe/qwq/miko/internals/AioListener.kt b/app/src/main/java/moe/qwq/miko/internals/AioListener.kt index 1d4e970..6a128c2 100644 --- a/app/src/main/java/moe/qwq/miko/internals/AioListener.kt +++ b/app/src/main/java/moe/qwq/miko/internals/AioListener.kt @@ -151,7 +151,7 @@ override fun onRecvMsg(recordLisrt: ArrayList) { GlobalScope.launch { val reader = ByteReadPacket(richMsg) val buffer = try { - if (reader.readUInt() == message.msgHead.peerId.toUInt()) { + if (reader.readUInt() == message.msgHead.peerId) { reader.discardExact(1) reader.readBytes(reader.readShort().toInt()) } else richMsg @@ -160,7 +160,9 @@ override fun onRecvMsg(recordLisrt: ArrayList) { } val recallData = ProtoBuf.decodeFromByteArray(buffer) - val groupCode = GroupHelper.groupUin2GroupCode(message.msgHead.peerId.toLong()) + if (recallData.type != 7u || recallData.peerId == 0u) return@launch + + val groupCode = recallData.peerId.toLong() val msgUid = message.content.msgUid val targetUid = recallData.operation.msgInfo?.senderUid ?: "" val operatorUid = recallData.operation.operatorUid ?: ""