mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-20 16:14:43 +08:00
fea1d28488
* feat: support friend group * remove unnecessary modifications * toByteArray2 * support friendGroup, with api dump * support rename, with api dump * modify as required * modify as required * reverse * doc * FriendGroups * api dump * modify as required * fix CI * FriendGroup sync notice * api dump * modify as required * immutable * add friends: ContactList in FriendGroup * more sync notice * modify log content * Change `FriendGroup.friends` to `Collection<Friend>` * Fix `FriendGroup.friends.isEmpty()` * modified as require, untested * del count and online count in info * change import * fix missing import * set @since 2.13 and modified as required * modified as required * modified as required * doc * change friendGroupId type to Int? * api dumped * change friendGroupId type to Int? * introduce null to friendGroupId * modified as required * chore * api dump * chore: remark * change int? to int * api dump * Update mirai-core-api/src/commonMain/kotlin/data/FriendGroups.kt Co-authored-by: Him188 <Him188@mamoe.net> * Move FriendGroup and FriendGroups to contact.friendgroup * Make `Friend.friendGroup` not null * add FriendGroups.default for default group * Redesign FriendGroup interface Co-authored-by: Karlatemp <kar@kasukusakura.com> Co-authored-by: Him188 <Him188@mamoe.net> |
||
---|---|---|
.. | ||
compatibility-validation | ||
src | ||
.gitignore | ||
build.gradle.kts | ||
README.md |
mirai-core
mirai 核心实现模块。首先阅读 mirai-core-api/README.md。
本文仅介绍重要部分。
架构
包名 | 描述 |
---|---|
net.mamoe.mirai.internal |
mirai 核心 API 的实现 |
.contact |
联系人实现 |
.message |
消息系统的实现 |
.network |
网络层实现 |
.utils |
工具类 |
net.mamoe.mirai.internal.contact
AbstractContact
所有 Contact
实现的基类. 实现生命周期等.
SendMessageHandler
处理 mirai 消息系统 Message
到协议数据结构的转换, 并处理长消息上传, 音乐转发上传等.
net.mamoe.mirai.internal.message
ReceiveMessageTransformer
处理协议数据结构到 Message
的转换. 设有 RefinableMessage
处理长消息下载, 合并转发下载并展开等.
RefinableMessage
支持处理长消息下载, 合并转发下载并展开等.
Image
实现
图片的实现的基类为 AbstractImage
.
在底层协议, 群图片与私聊图片很不同. 因此图片实现可以是 GroupImage
或 FriendImage
.
图片又细分了 OnlineImage
和 OfflineImage
. 故有 OnlineGroupImage
等四个类型, 及他们分别的 Impl
.
OnlineImage
为通过 Contact.uploadImage
上传得到的, 或刚刚从服务器接收的图片对象. OfflineImage
则为反序列化得到的对象.
MessageSource
实现
MessageSource
在协议底层十分复杂,