diff --git a/mirai-core-api/compatibility-validation/android/api/android.api b/mirai-core-api/compatibility-validation/android/api/android.api index 44fed993d..7fe2e8c5d 100644 --- a/mirai-core-api/compatibility-validation/android/api/android.api +++ b/mirai-core-api/compatibility-validation/android/api/android.api @@ -904,9 +904,11 @@ public abstract interface class net/mamoe/mirai/contact/announcement/Announcemen public abstract fun delete (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun get (Ljava/lang/String;)Lnet/mamoe/mirai/contact/announcement/OnlineAnnouncement; public abstract fun get (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun members (Ljava/lang/String;Z)Ljava/util/List; public abstract fun members (Ljava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun publish (Lnet/mamoe/mirai/contact/announcement/Announcement;)Lnet/mamoe/mirai/contact/announcement/OnlineAnnouncement; public abstract fun publish (Lnet/mamoe/mirai/contact/announcement/Announcement;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun remind (Ljava/lang/String;)V public abstract fun remind (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;)Lnet/mamoe/mirai/contact/announcement/AnnouncementImage; public abstract fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/mirai-core-api/compatibility-validation/jvm/api/jvm.api b/mirai-core-api/compatibility-validation/jvm/api/jvm.api index 19f1110e2..cb0d4aceb 100644 --- a/mirai-core-api/compatibility-validation/jvm/api/jvm.api +++ b/mirai-core-api/compatibility-validation/jvm/api/jvm.api @@ -904,9 +904,11 @@ public abstract interface class net/mamoe/mirai/contact/announcement/Announcemen public abstract fun delete (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun get (Ljava/lang/String;)Lnet/mamoe/mirai/contact/announcement/OnlineAnnouncement; public abstract fun get (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun members (Ljava/lang/String;Z)Ljava/util/List; public abstract fun members (Ljava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun publish (Lnet/mamoe/mirai/contact/announcement/Announcement;)Lnet/mamoe/mirai/contact/announcement/OnlineAnnouncement; public abstract fun publish (Lnet/mamoe/mirai/contact/announcement/Announcement;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public fun remind (Ljava/lang/String;)V public abstract fun remind (Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;)Lnet/mamoe/mirai/contact/announcement/AnnouncementImage; public abstract fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/mirai-core-api/src/commonMain/kotlin/contact/announcement/Announcements.kt b/mirai-core-api/src/commonMain/kotlin/contact/announcement/Announcements.kt index 91afae201..5e8bc0309 100644 --- a/mirai-core-api/src/commonMain/kotlin/contact/announcement/Announcements.kt +++ b/mirai-core-api/src/commonMain/kotlin/contact/announcement/Announcements.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 Mamoe Technologies and contributors. + * Copyright 2019-2023 Mamoe Technologies and contributors. * * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link. @@ -7,6 +7,8 @@ * https://github.com/mamoe/mirai/blob/dev/LICENSE */ +@file:JvmBlockingBridge + package net.mamoe.mirai.contact.announcement import kotlinx.coroutines.flow.Flow @@ -19,6 +21,7 @@ import net.mamoe.mirai.utils.ExternalResource import net.mamoe.mirai.utils.NotStableForInheritance import net.mamoe.mirai.utils.Streamable import kotlin.jvm.JvmName +import kotlin.jvm.JvmSynthetic /** @@ -55,7 +58,6 @@ public interface Announcements : Streamable { * * @see OnlineAnnouncement.delete */ - @JvmBlockingBridge public suspend fun delete(fid: String): Boolean /** @@ -64,7 +66,6 @@ public interface Announcements : Streamable { * @return 返回 `null` 表示不存在该 [fid] 的群公告 * @throws IllegalStateException 当协议异常时抛出 */ - @JvmBlockingBridge public suspend fun get(fid: String): OnlineAnnouncement? /** @@ -73,7 +74,6 @@ public interface Announcements : Streamable { * @throws IllegalStateException 当协议异常时抛出 * @see Announcement.publishTo */ - @JvmBlockingBridge public suspend fun publish(announcement: Announcement): OnlineAnnouncement /** @@ -82,7 +82,6 @@ public interface Announcements : Streamable { * **注意**: 需要由调用方[关闭][ExternalResource.close] [resource]. * @throws IllegalStateException 当协议异常时抛出 */ - @JvmBlockingBridge public suspend fun uploadImage(resource: ExternalResource): AnnouncementImage /** @@ -96,6 +95,7 @@ public interface Announcements : Streamable { * @throws IllegalStateException 当协议异常时抛出 * * @see OnlineAnnouncement.members + * @since 2.14 */ public suspend fun members(fid: String, confirmed: Boolean): List @@ -119,5 +119,6 @@ public interface Announcements : Streamable { level = DeprecationLevel.HIDDEN ) @DeprecatedSinceMirai(hiddenSince = "2.13") + @JvmSynthetic // no blocking bridge public suspend fun asFlow0(): Flow = asFlow() }