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

Redesign notice handling and introduce NoticeProcessorPipeline #1369

Merged
merged 54 commits into from
Sep 1, 2021

Conversation

Him188
Copy link
Member

@Him188 Him188 commented Jun 26, 2021

  • 优化内部实现代码,去重,dump trash
  • 分割 decode 和处理: PacketFactory 处理同步与解析等逻辑, 将结果提交给 NoticeProcessorPipeline
  • 按事件类型分类处理来自服务器事件, 如 GroupListNoticeProcessor
  • 允许写测试
  • 增加可读性
  • 顺便修复恢复群主身份时的事件
  • 顺便修复 StrangerAddedEvent 重复广播问题
  • 顺便修复 Stranger 没有 close 的问题
  • 顺便修复一些 Contact 的 scope parent 问题
  • 顺便修复 IMirai.newStranger 的安全性问题

@Him188 Him188 added t:enhancement 类型: 现有功能上的优化 N 优先级: 一般 labels Jun 26, 2021
@Him188 Him188 modified the milestones: 2.7-M2, 2.8-M1 Jun 26, 2021
final override val asStranger: StrangerImpl by lazy {
Mirai.newStranger(this, StrangerInfoImpl(bot.id, bot.nick)).cast()
}
final override var nick: String by asFriend.info::nick
Copy link
Member

Choose a reason for hiding this comment

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

nick 在登录完成后会进行最后一次初始化校检, 使用的是 try-catch, 现在不是 lateinit var 了会导致最后的初始化校检不执行

Copy link
Member Author

Choose a reason for hiding this comment

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

Where? 估计在网路重构时删了
image

Copy link
Member

Choose a reason for hiding this comment

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

还真没了
#1023
f12f78a

Copy link
Collaborator

Choose a reason for hiding this comment

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

实际上 nick 应该不存在这种问题了 传过来的 tlv 会告诉你 nick,不过还是加上比较好

@Him188 Him188 force-pushed the NoticeProcessorPipeline branch 3 times, most recently from 2b221b7 to 4e95154 Compare July 3, 2021 13:37
@Him188 Him188 modified the milestones: 2.8-M1, 2.8 Jul 7, 2021
@Him188

This comment has been minimized.

@Him188 Him188 force-pushed the NoticeProcessorPipeline branch 2 times, most recently from 329d7ec to 6e2d575 Compare August 13, 2021 08:22
@Him188 Him188 force-pushed the NoticeProcessorPipeline branch from e4a9440 to 65d6a08 Compare August 25, 2021 07:37
Him188 added 3 commits August 25, 2021 18:44
- GroupRetrieveTest
- GroupTransferTest
- MemberAdminChangeTest
- MemberQuitTest
- MuteTest
@Him188 Him188 force-pushed the NoticeProcessorPipeline branch from 65d6a08 to 70f2b04 Compare August 25, 2021 10:46
@Him188 Him188 marked this pull request as ready for review August 27, 2021 09:19
@Him188 Him188 linked an issue Aug 27, 2021 that may be closed by this pull request
@Him188 Him188 linked an issue Aug 27, 2021 that may be closed by this pull request
@Him188 Him188 force-pushed the NoticeProcessorPipeline branch from 327f812 to 2cc101e Compare September 1, 2021 05:51
@Him188 Him188 merged commit 4d76aa8 into dev Sep 1, 2021
@Him188 Him188 deleted the NoticeProcessorPipeline branch September 1, 2021 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
N 优先级: 一般 t:enhancement 类型: 现有功能上的优化
Projects
None yet
3 participants