mirai/ci-release-helper/changelogs/2.15.0-M1.md
2023-03-19 12:01:42 +00:00

53 lines
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## mirai-core
### 不兼容变更
- 删除了旧版的为兼容 Java 生成的阻塞式方法桥
> 这只会导致依赖 mirai [2.1.0](https://github.com/mamoe/mirai/releases/tag/2.1.0) (发布于 2 年前) 编译的 Java 代码现在无法使用 mirai 2.15.0-M1 级以上版本运行. 将它们使用 2.15.0-M1 及以上重新编译即可运行.
>
> 这是因为 KJBB 以前有 bug, 会生成返回值为 `Unit` 的方法桥. mirai 为了兼容, 一直让 KJBB 既生成返回 `Unit` 的, 也生成返回 `void` 的. 但自 Kotiln 编译器 1.8.0 起, 其 IR lowering 会把 `companion object` 中的静态函数 `@JvmStatic` 的返回值由 `Unit` 变更为 `void`, 导致编译器插件 KJBB 不再能做兼容.
### 新特性
- 支持扫码登录 (#2502 with @StageGuard, #1281)
新的登录方法通过 `BotAuthorization` & `BotFactory.newBot(id: Long, authorization: BotAuthorization)` 登录
关于详细的使用方法请参考 `BotAuthorization` 的注释
扫码登录的实现不一定稳定 (因为涉及修改了大量内部登录和维护在线逻辑), 文档也还在正在准备中.
**在 2.15.0-RC 可能会修改扫码登录的 API**.
> mirai-console **尚未支持
**在命令中指定扫码登录, 但是提供了 `MiraiConsole.addBot(id: Long, authorization: BotAuthorization)` 用于扫码登录
### 优化和修复
- 更新 Kotlin 到 1.8.10, kotlinx-serialization 到 1.5.0 (#2578)
- 修复特殊情况可能无法加载 services 的问题 (#2268, #2511 by @Nambers, #2428 by @cssxsh)
> 例如在 Minecraft 插件中
- 增加 TxCaptchaHelper 可用性无法保证的警告 (#2564 by @MrXiaoM)
- 修正消息多态序列化, 输出的 JSON 不再包含多余的 "type" 字段 (#2414)
- 修正群公告发送失败报错 `no login` (#2069, #2512 by @cssxsh)
- 修正使用 `Announcements.get(fid)` 出现 `kotlinx.serialization.MissingFieldException: Field 'msg'` (#2509, #2512 by @cssxsh)
- 修正短暂断网时不能成功重连 (#2488, #2504, #2505 by @sandtechnology)
- 修复 `OfflineMessageSource` 回复时, 引用回复的 At 变空白的问题 (#2501)
- 在无法连接服务器时在报错信息中携带尝试连接的服务器 (#2576 by @cssxsh)
- 修正 dumpTlvMap 返回值不正确的问题 (内部) (#2557 by @MrXiaoM)
- 修正文档细节 (#2547 by @7aGiven)
## mirai-core-mock
- 在 upload 后的 MockImage 中提供 size 属性 (#2515)
## mirai-console
### 新特性
- JvmPlugin 以 `getResource` 方法获取全局资源文件 (#2536 by @ArgonarioD)
- 添加新事件 `StartupEvent`, `AutoLoginEvent` (#2446 by @cssxsh)
> 分别在 Console 启动完成后, 和自动登录后触发
### 优化和修复
- 文档修正(#2503 by @7aGiven, #2506 by @7aGiven, #2457 by @char-46, #2577 by @cssxsh, #2491 by @EnchStudio)
- 修复在Android系统运行时被杀后台时抛出的 InterruptedException 导致崩溃 (#2474 by @zhaodice)
- 修复使用 Console 扩展时,对于扩展的函数返回非 null 值报错的情况 (#2528 by @NoMathExpectation)