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

add seq based roaming support for group #2549

Closed
wants to merge 0 commits into from

Conversation

StageGuard
Copy link
Member

No description provided.

@StageGuard StageGuard marked this pull request as ready for review March 6, 2023 09:45
@StageGuard
Copy link
Member Author

#2513

@StageGuard StageGuard marked this pull request as draft March 23, 2023 09:57
@StageGuard
Copy link
Member Author

把这个也放到 rc 吧

@Him188
Copy link
Member

Him188 commented Apr 14, 2023

发版之前写完就放

@Him188 Him188 added the s:core 子系统: mirai-core label Apr 14, 2023
@StageGuard StageGuard marked this pull request as ready for review April 14, 2023 13:19
@StageGuard StageGuard requested review from Him188 and Karlatemp and removed request for Him188 May 7, 2023 02:02
* @see MessageSource
*/
public suspend fun getMessagesBefore(
messageId: Int? = null,
Copy link
Member

Choose a reason for hiding this comment

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

使用原始数据并不是一个好的做法,id 处理细节应该被隐藏, 用 MessageSource

而且用 messageId 不适合匹配别的 contact 实现

Copy link
Member

@Him188 Him188 May 7, 2023

Choose a reason for hiding this comment

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

我觉得 source 不好,就用 message id 就够了
source里面有的东西太多了,source还有sender 和 receiver, 传进去还得额外考虑这个的行为,得查它 sender 和 receiver 与这个 contact 相关,也得查 kind

* @since 2.15
* @see MessageSource
*/
public suspend fun getMessagesBefore(
Copy link
Member

Choose a reason for hiding this comment

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

Before 语义上是不包含给定的起始信息本身的, 我的想法是让这个方法返回的流中的返回包含给定的信息本身可能会更好

Copy link
Member

Choose a reason for hiding this comment

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

可以都支持,把这个查询条件抽象出来,比如 Range.before/after/exact(id, inclusive = true), 还能加 after 与 in,自由更改参数,而不会增加和维护过多 getMessage “重载”,但这会一定程度增加复杂度,不过我感觉还好?

@Him188 Him188 added this to the 2.16.0-RC milestone May 21, 2023
@Karlatemp
Copy link
Member

6, 这merge了个啥

@@ -1056,17 +1056,19 @@ public final class net/mamoe/mirai/contact/roaming/RoamingMessageFilter$Companio

public abstract interface class net/mamoe/mirai/contact/roaming/RoamingMessages {
public fun getAllMessages (Lnet/mamoe/mirai/contact/roaming/RoamingMessageFilter;)Lkotlinx/coroutines/flow/Flow;
public fun getAllMessages (Lnet/mamoe/mirai/contact/roaming/RoamingMessageFilter;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun getAllMessages (Lnet/mamoe/mirai/contact/roaming/RoamingMessageFilter;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Copy link
Member Author

Choose a reason for hiding this comment

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

abi changes

@@ -1056,17 +1056,19 @@ public final class net/mamoe/mirai/contact/roaming/RoamingMessageFilter$Companio

public abstract interface class net/mamoe/mirai/contact/roaming/RoamingMessages {
public fun getAllMessages (Lnet/mamoe/mirai/contact/roaming/RoamingMessageFilter;)Lkotlinx/coroutines/flow/Flow;
public fun getAllMessages (Lnet/mamoe/mirai/contact/roaming/RoamingMessageFilter;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun getAllMessages (Lnet/mamoe/mirai/contact/roaming/RoamingMessageFilter;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Copy link
Member Author

Choose a reason for hiding this comment

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

abi changes

@StageGuard StageGuard deleted the seq-based-roaming branch July 26, 2023 09:13
@Karlatemp Karlatemp removed this from the 2.16.0-RC milestone Jul 26, 2023
@Him188 Him188 removed their request for review July 29, 2023 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:core 子系统: mirai-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants