From e9884a5fa8a67ed350c5ddf0b7a3f29211f6a9a7 Mon Sep 17 00:00:00 2001 From: Simplxs Date: Wed, 21 Feb 2024 00:08:41 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug(=E6=9A=82=E6=9C=AA=E5=AE=8C=E6=88=90?= =?UTF-8?q?=20=E8=AF=B7=E5=8B=BF=E4=BD=BF=E7=94=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/moe/fuqiuluo/qqinterface/servlet/MsgSvc.kt | 3 ++- .../remote/action/handlers/SendForwardMessage.kt | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/MsgSvc.kt b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/MsgSvc.kt index a6a95c5..efa838d 100644 --- a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/MsgSvc.kt +++ b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/MsgSvc.kt @@ -239,6 +239,7 @@ internal object MsgSvc : BaseSvc() { ) ) ) + LogCenter.log(ProtoBuf.encodeToByteArray(payload).toHexString(), Level.DEBUG) val req = LongMsgReq( sendInfo = SendLongMsgInfo( @@ -292,7 +293,7 @@ internal object MsgSvc : BaseSvc() { if (it.command == "MultiMsg") { return Result.success(it.data?.body?.map { msg -> val chatType = - if (msg.content!!.msgType == 1) MsgConstant.KCHATTYPEC2C else MsgConstant.KCHATTYPEGROUP + if (msg.content!!.msgType == 82) MsgConstant.KCHATTYPEGROUP else MsgConstant.KCHATTYPEC2C MessageDetail( time = msg.content?.msgTime?.toInt() ?: 0, msgType = MessageHelper.obtainDetailTypeByMsgType(chatType), diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/SendForwardMessage.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/SendForwardMessage.kt index 8a336ee..b653390 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/SendForwardMessage.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/SendForwardMessage.kt @@ -107,7 +107,13 @@ internal object SendForwardMessage : IActionHandler() { ) else null ), content = MessageContent( - msgType = record.msgType, + msgType = when (record.chatType) { + MsgConstant.KCHATTYPEC2C -> 529 + MsgConstant.KCHATTYPEGROUP -> 82 + else -> throw UnsupportedOperationException( + "Unsupported chatType: $chatType" + ) + }, msgViaRandom = record.msgId, msgSeq = record.msgSeq, msgTime = record.msgTime, @@ -160,7 +166,7 @@ internal object SendForwardMessage : IActionHandler() { peerUid = data["uid"]?.asString ?: TicketSvc.getUid() ), content = MessageContent( - msgType = 166, + msgType = 529, msgViaRandom = 4, msgSeq = data["seq"]?.asLong ?: Random.nextLong(), msgTime = data["time"]?.asLong ?: (System.currentTimeMillis() / 1000),