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

Release: v4.0.2 #176

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changelog/v4.0.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
> [!note]
> 对应核心版本: [**v4.6.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v4.6.0)
我们欢迎并期望着您的 [反馈](https://github.com/simple-robot/simbot-component-kook/issues)[协助](https://github.com/simple-robot/simbot-component-kook/pulls),感谢您的贡献与支持!
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v4.0.2

> Release & Pull Notes: [v4.0.2](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.2)
- fix(core): 修复事件中接收的 MessageContent 中, `referenceMessage` 的行为与 `reference` 不一致,会错误地获取自身消息详情而非引用消息详情的问题 ([`517e442`](https://github.com/simple-robot/simpler-robot/commit/517e442))

# v4.0.1

> Release & Pull Notes: [v4.0.1](https://github.com/simple-robot/simpler-robot/releases/tag/v4.0.1)
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/P.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ object P : ProjectDetail() {
override val homepage: String
get() = HOMEPAGE

const val VERSION = "4.0.1"
const val NEXT_VERSION = "4.0.2"
const val VERSION = "4.0.2"
const val NEXT_VERSION = "4.0.3"

override val snapshotVersion = "$NEXT_VERSION-SNAPSHOT"
override val version = if (isSnapshot()) snapshotVersion else VERSION
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,10 @@ public class KookReceiveMessageContent internal constructor(
}
}

override suspend fun referenceMessage(): KookMessageContent {
override suspend fun referenceMessage(): KookMessageContent? {
return if (isDirect) {
val details = detailsFromDirect(bot, source.msgId, source.authorId)
val ref = referenceFromDirect(bot, source.msgId, source.authorId) ?: return null
val details = detailsFromDirect(bot, ref.quote.id, source.authorId)
KookUpdatedMessageContent(
bot = bot,
isDirect = false,
Expand All @@ -277,7 +278,8 @@ public class KookReceiveMessageContent internal constructor(
isMentionHere = false
)
} else {
val details = detailsFromChannel(bot, source.msgId)
val ref = referenceFromChannel(bot, source.msgId) ?: return null
val details = detailsFromChannel(bot, ref.quote.id)
details.toContent(bot)
}
}
Expand Down Expand Up @@ -344,9 +346,11 @@ public class KookUpdatedMessageContent internal constructor(
}

@JvmSynthetic
override suspend fun referenceMessage(): KookMessageContent {
override suspend fun referenceMessage(): KookMessageContent? {
return if (isDirect) {
val details = detailsFromDirectWithChatCode(bot, msgId, chatCode!!)
val chatCode = chatCode!!
val ref = referenceFromDirectWithChatCode(bot, msgId, chatCode) ?: return null
val details = detailsFromDirectWithChatCode(bot, ref.quote.id, chatCode)
KookUpdatedMessageContent(
bot = bot,
isDirect = false,
Expand All @@ -359,7 +363,8 @@ public class KookUpdatedMessageContent internal constructor(
isMentionHere = false
)
} else {
val details = detailsFromChannel(bot, msgId)
val ref = referenceFromChannel(bot, msgId) ?: return null
val details = detailsFromChannel(bot, ref.quote.id)
details.toContent(bot)
}
}
Expand Down
Loading