mirror of
https://github.com/mamoe/mirai.git
synced 2024-12-27 09:00:15 +08:00
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:
parent
8ef909a306
commit
057708e637
@ -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
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -216,7 +216,6 @@ internal class GroupImpl constructor(
|
||||
picWidth = imageInfo.width,
|
||||
picHeight = imageInfo.height,
|
||||
picType = getIdByImageType(imageInfo.imageType),
|
||||
originalPic = 1
|
||||
), 5000, 2
|
||||
)
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user