From ca7f0e04bff4f5bb3a77e33a8414fe0fe84e57d6 Mon Sep 17 00:00:00 2001 From: Eritque arcus <1930893235@qq.com> Date: Mon, 10 Jan 2022 10:27:50 +0800 Subject: [PATCH] chore(kotlin, cpp): prepare v2.9.1 Former-commit-id: ad631a15d32618b220b70cde757942cece948fc3 --- CHANGELOG.md | 7 +++++++ cpp/include/MessageChain.cpp | 1 + cpp/include/utils.cpp | 2 +- cpp/include/utils.h | 2 +- kotlin/buildSrc/src/main/kotlin/Version.kt | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2a21df5f..fb91d6345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ # Change Log +## v2.9.1 + ++ mirai版本更新到v2.9.2 ++ 内部优化 #106 ++ 支持转发转发信息 ++ 支持MessagePreSendEvent(但是还不支持中断或更改发送) ++ 支持注册命令(loader只支持控制台命令, plugin是对接mirai的命令系统的rawCommand) ## v2.9.0-M2 diff --git a/cpp/include/MessageChain.cpp b/cpp/include/MessageChain.cpp index 63c8800ef..cb4c4c3b8 100644 --- a/cpp/include/MessageChain.cpp +++ b/cpp/include/MessageChain.cpp @@ -118,6 +118,7 @@ namespace MiraiCP { if (origin) j = tmp["originalMessage"]; MessageChain mc; + if (j.empty()) return mc; if (j[0]["type"] == "MessageOrigin") { mc.add(OnlineForwardedMessage::deserializationFromMessageSourceJson(j)); return mc; diff --git a/cpp/include/utils.cpp b/cpp/include/utils.cpp index c6497012c..a5e5e9408 100644 --- a/cpp/include/utils.cpp +++ b/cpp/include/utils.cpp @@ -232,7 +232,7 @@ JNIEXPORT jstring Event(JNIEnv *env, jobject, jstring content) { // command std::optional c = std::nullopt; if (j.contains("contact")) c = Contact::deserialize(j["contact"]); - CommandManager::commandManager[j["bindId"]]->onCommand(c, Bot(j["botid"]), MessageChain::deserializationFromMessageSourceJson(j["message"].get(), false)); + CommandManager::commandManager[j["bindId"]]->onCommand(c, Bot(j["botid"]), MessageChain::deserializationFromMessageSourceJson((j.contains("message") ? j["message"].get() : ""), false)); break; } default: diff --git a/cpp/include/utils.h b/cpp/include/utils.h index bc324c86e..1307f663f 100644 --- a/cpp/include/utils.h +++ b/cpp/include/utils.h @@ -19,7 +19,7 @@ #include "CPPPlugin.h" namespace MiraiCP { - const std::string MiraiCPVersion = "v2.9.0-M2"; + const std::string MiraiCPVersion = "v2.9.1"; inline void schedule(long time, const std::string &msg, JNIEnv *env = nullptr); void enrollPlugin(); diff --git a/kotlin/buildSrc/src/main/kotlin/Version.kt b/kotlin/buildSrc/src/main/kotlin/Version.kt index 1f4ecc4b6..3664e30a7 100644 --- a/kotlin/buildSrc/src/main/kotlin/Version.kt +++ b/kotlin/buildSrc/src/main/kotlin/Version.kt @@ -22,7 +22,7 @@ object Version { const val `kotlinx-coroutines-core` = "1.6.0" const val mirai = "2.9.2" - const val miraiCP = "2.9.0-M2" + const val miraiCP = "2.9.1" const val shadowJar = "7.1.1" const val mavenCenterPublish = "1.0.0-dev-1"