Fix broken image and gif issue (#2114)

* Try to fix broken image issue #1699

* Re-add deleted comma at tail
This commit is contained in:
sandtechnology 2022-07-01 09:00:27 +08:00 committed by GitHub
parent 8ef909a306
commit 057708e637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View File

@ -95,7 +95,8 @@ internal sealed class AbstractUser(
imgHeight = imageInfo.height,
imgType = getIdByImageType(imageInfo.imageType),
fileName = "${resource.md5.toUHexString("")}.${resource.formatName}",
imgOriginal = true,
//For gif, using not original
imgOriginal = (imageInfo.imageType != ImageType.GIF),
buildVer = bot.client.buildVer,
),
), 5000, 2
@ -156,6 +157,7 @@ internal sealed class AbstractUser(
picWidth = imageInfo.width,
picHeight = imageInfo.height,
picType = getIdByImageType(imageInfo.imageType),
buType = 2, // not group
)
)

View File

@ -216,7 +216,6 @@ internal class GroupImpl constructor(
picWidth = imageInfo.width,
picHeight = imageInfo.height,
picType = getIdByImageType(imageInfo.imageType),
originalPic = 1
), 5000, 2
)

View File

@ -76,7 +76,6 @@ internal class InternalImageProtocolImpl : InternalImageProtocol {
picWidth = width,
picHeight = height,
picType = getIdByImageType(type),
originalPic = 1
)
)
@ -107,7 +106,8 @@ internal class InternalImageProtocolImpl : InternalImageProtocol {
imgHeight = height,
imgType = getIdByImageType(type),
fileName = "${md5.toUHexString("")}.${type.formatName}",
imgOriginal = true,
//For gif, using not original
imgOriginal = (type != ImageType.GIF),
buildVer = bot.client.buildVer,
),
)
@ -138,7 +138,6 @@ internal class InternalImageProtocolImpl : InternalImageProtocol {
picWidth = width,
picHeight = height,
picType = getIdByImageType(type),
originalPic = 1
)
)

View File

@ -45,9 +45,8 @@ internal class ImgStore {
filename: String = getRandomString(16) + ".gif", // make server happier
srcTerm: Int = 5,
platformType: Int = 9,
buType: Int = 2,
buType: Int = 1, // group 1, other 2
appPicType: Int = 1006,
originalPic: Int = 1
) = buildOutgoingUniPacket(client) {
writeProtoBuf(
Cmd0x388.ReqBody.serializer(),
@ -69,7 +68,12 @@ internal class ImgStore {
buildVer = client.buildVer,
srcTerm = srcTerm,
platformType = platformType,
originalPic = originalPic,
//For gif, not original there
originalPic = if (picType == 2000) {
0
} else {
1
},
buType = buType
)
)