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

Rename RichMessageOrigin to MessageOrigin #1116

Merged
merged 6 commits into from Apr 3, 2021
Merged

Conversation

Him188
Copy link
Member

@Him188 Him188 commented Mar 26, 2021

为了添加 Dice 的 origin

message/MarketFaceImpl.kt:47

delegate.toDiceOrNull()?.let { return it } // TODO: 2021/2/12 add dice origin, maybe rename MessageOrigin

可能有更好的命名, 姑且先改叫 MessageOrigin

@Him188 Him188 added the t:enhancement 类型: 现有功能上的优化 label Mar 26, 2021
@Him188 Him188 requested a review from Karlatemp March 26, 2021 12:02
@Him188 Him188 added this to the 2.6.0 milestone Mar 26, 2021
@Karlatemp
Copy link
Member

是否需要像以前一样先保留一段时间的二进制兼容(已经无法使用)再彻底删除?

@Him188
Copy link
Member Author

Him188 commented Mar 26, 2021

是否需要像以前一样先保留一段时间的二进制兼容(已经无法使用)再彻底删除?

似乎不容易提供兼容

Copy link
Member

@Karlatemp Karlatemp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public class MessageOrigin(
/**
* 原 [RichMessage].
*/
public val origin: @Polymorphic RichMessage,

如果要重命名为 MessageOrigin, 此处 origin 类型也应该随之修改

@Him188
Copy link
Member Author

Him188 commented Mar 26, 2021

public class MessageOrigin(
/**
* 原 [RichMessage].
*/
public val origin: @Polymorphic RichMessage,

如果要重命名为 MessageOrigin, 此处 origin 类型也应该随之修改

那就不容易改了, any suggestions?

@Karlatemp
Copy link
Member

public class MessageOrigin(
/**
* 原 [RichMessage].
*/
public val origin: @Polymorphic RichMessage,

如果要重命名为 MessageOrigin, 此处 origin 类型也应该随之修改

那就不容易改了, any suggestions?

改成 Message/MessageContent 吧, 未来也容易扩展

Reason: UnsupportedMessage + RichMessage + MarketFace

@Him188 Him188 requested a review from Karlatemp March 28, 2021 04:16
Copy link
Member

@Karlatemp Karlatemp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不过原来序列化后 type: "RichMessageOrigin" 的反序列化会不会出错,直接序列化 MessageChain 的可能不知道 RichMessageOrigin 的存在

@Him188
Copy link
Member Author

Him188 commented Mar 28, 2021

不过原来序列化后 type: "RichMessageOrigin" 的反序列化会不会出错,直接序列化 MessageChain 的可能不知道 RichMessageOrigin 的存在

会出错, 那可以写一个反序列化兼容层

@Him188 Him188 marked this pull request as draft March 28, 2021 05:18
@Him188
Copy link
Member Author

Him188 commented Apr 3, 2021

发现其实在 2.3 就没有提供序列化支持...

@Him188 Him188 requested a review from Karlatemp April 3, 2021 14:58
@Him188 Him188 marked this pull request as ready for review April 3, 2021 14:58
@Him188 Him188 merged commit 7521e6d into dev Apr 3, 2021
@Him188 Him188 deleted the him188/message_origin branch April 3, 2021 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:enhancement 类型: 现有功能上的优化
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants