Use long image size

This commit is contained in:
Him188 2021-01-31 15:17:07 +08:00
parent c572a7e434
commit 248ed34155
4 changed files with 5 additions and 6 deletions

View File

@ -116,7 +116,7 @@ internal abstract class AbstractUser(
uin = bot.id,
groupCode = id,
md5 = resource.md5,
size = resource.size.toInt()
size = resource.size
).sendAndExpect(bot)
when (response) {

View File

@ -144,7 +144,7 @@ internal class GroupImpl(
uin = bot.id,
groupCode = id,
md5 = resource.md5,
size = resource.size.toInt()
size = resource.size
).sendAndExpect()
when (response) {

View File

@ -680,7 +680,7 @@ internal class ImMsgBody : ProtoBuf {
@Serializable
internal class NotOnlineImage(
@ProtoNumber(1) @JvmField val filePath: String = "",
@ProtoNumber(2) @JvmField val fileLen: Int = 0,
@ProtoNumber(2) @JvmField val fileLen: Long = 0L, // originally int
@ProtoNumber(3) @JvmField val downloadPath: String = "",
@ProtoNumber(4) @JvmField val oldVerSendFile: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoNumber(5) @JvmField val imgType: Int = 0,

View File

@ -19,7 +19,6 @@ import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.internal.network.protocol.packet.buildOutgoingUniPacket
import net.mamoe.mirai.internal.utils.io.serialization.readProtoBuf
import net.mamoe.mirai.internal.utils.io.serialization.writeProtoBuf
import net.mamoe.mirai.utils.toLongUnsigned
import kotlin.random.Random
import kotlin.random.nextInt
@ -39,7 +38,7 @@ internal class ImgStore {
uin: Long,
groupCode: Long,
md5: ByteArray,
size: Int,
size: Long,
picWidth: Int = 0, // not orthodox
picHeight: Int = 0, // not orthodox
picType: Int = 1000,
@ -61,7 +60,7 @@ internal class ImgStore {
groupCode = groupCode,
srcUin = uin,
fileMd5 = md5,
fileSize = size.toLongUnsigned(),
fileSize = size,
fileId = fileId,
fileName = filename,
picWidth = picWidth,