mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: fix 群聊转发图片
This commit is contained in:
parent
93c49953cf
commit
7d0b60271e
@ -12,6 +12,7 @@ import moe.fuqiuluo.qqinterface.servlet.ark.WeatherSvc
|
||||
import moe.fuqiuluo.qqinterface.servlet.msg.toJson
|
||||
import moe.fuqiuluo.qqinterface.servlet.msg.toSegments
|
||||
import moe.fuqiuluo.qqinterface.servlet.transfile.NtV2RichMediaSvc
|
||||
import moe.fuqiuluo.qqinterface.servlet.transfile.NtV2RichMediaSvc.fetchGroupResUploadTo
|
||||
import moe.fuqiuluo.shamrock.helper.*
|
||||
import moe.fuqiuluo.shamrock.helper.MessageHelper.messageArrayToRichText
|
||||
import moe.fuqiuluo.shamrock.helper.MessageHelper.obtainMessageTypeByDetailType
|
||||
@ -271,7 +272,7 @@ internal class ElemMaker {
|
||||
when(chatType) {
|
||||
MsgConstant.KCHATTYPEGROUP -> {
|
||||
sceneType = 2u
|
||||
grp = GroupUserInfo(peerId.toULong())
|
||||
grp = GroupUserInfo(fetchGroupResUploadTo().toULong())
|
||||
}
|
||||
MsgConstant.KCHATTYPEC2C -> {
|
||||
sceneType = 1u
|
||||
|
@ -19,7 +19,6 @@ import kotlinx.coroutines.withTimeoutOrNull
|
||||
import moe.fuqiuluo.qqinterface.servlet.BaseSvc
|
||||
import moe.fuqiuluo.qqinterface.servlet.TicketSvc
|
||||
import moe.fuqiuluo.qqinterface.servlet.transfile.data.TryUpPicData
|
||||
import moe.fuqiuluo.shamrock.helper.LogCenter
|
||||
import moe.fuqiuluo.shamrock.helper.MessageHelper
|
||||
import moe.fuqiuluo.shamrock.remote.service.config.ShamrockConfig
|
||||
import moe.fuqiuluo.shamrock.tools.hex2ByteArray
|
||||
@ -62,7 +61,7 @@ import kotlin.time.Duration
|
||||
internal object NtV2RichMediaSvc: BaseSvc() {
|
||||
private val requestIdSeq = atomic(2L)
|
||||
|
||||
private fun fetchGroupResUploadTo(): String {
|
||||
fun fetchGroupResUploadTo(): String {
|
||||
return ShamrockConfig.getUpResGroup().ifEmpty { "100000000" }
|
||||
}
|
||||
|
||||
@ -462,12 +461,12 @@ internal object NtV2RichMediaSvc: BaseSvc() {
|
||||
tryFastUploadCompleted = true,
|
||||
srvSendMsg = false,
|
||||
clientRandomId = Random.nextULong(),
|
||||
compatQMsgSceneType = 1u,
|
||||
compatQMsgSceneType = 2u,
|
||||
clientSeq = Random.nextUInt(),
|
||||
noNeedCompatMsg = false
|
||||
noNeedCompatMsg = true
|
||||
)
|
||||
).toByteArray()
|
||||
val buffer = sendOidbAW("OidbSvcTrpcTcp.0x11c5_100", 4549, 100, req, true, timeout = 3_000)?.slice(4)
|
||||
val buffer = sendOidbAW("OidbSvcTrpcTcp.0x11c4_100", 4548, 100, req, true, timeout = 3_000)?.slice(4)
|
||||
?: return Result.failure(Exception("no response: timeout"))
|
||||
val rspBuffer = buffer.decodeProtobuf<TrpcOidb>().buffer
|
||||
val rsp = rspBuffer.decodeProtobuf<NtV2RichMediaRsp>()
|
||||
|
Loading…
x
Reference in New Issue
Block a user