Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: FileMessage.Delegate SerialName #2041

Merged
merged 1 commit into from
May 18, 2022

Conversation

cssxsh
Copy link
Contributor

@cssxsh cssxsh commented May 18, 2022

FileMessage 错误地使用了 Image.SERIAL_NAME

public object Serializer : KSerializer<FileMessage> by FallbackSerializer("FileMessage") // not polymorphic
@MiraiInternalApi
private open class FallbackSerializer(serialName: String) : KSerializer<FileMessage> by Delegate.serializer().map(
Delegate.serializer().descriptor.copy(serialName),
serialize = { Delegate(id, internalId, name, size) },
deserialize = { Mirai.createFileMessage(id, internalId, name, size) },
) {
@SerialName(Image.SERIAL_NAME)
@Serializable
data class Delegate(
val id: String,
val internalId: Int,
val name: String,
val size: Long,
)
}

@Him188 Him188 added t:bug 类型: bug s:core 子系统: mirai-core labels May 18, 2022
@Him188 Him188 added this to the 2.12.0-RC milestone May 18, 2022
@Him188 Him188 merged commit a1a517c into mamoe:dev May 18, 2022
cssxsh added a commit to SkyNet1748/mirai that referenced this pull request Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:core 子系统: mirai-core t:bug 类型: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants