[core] Generate blocking bridges for Announcements.members and Announcements.remind

This commit is contained in:
Him188 2023-05-06 11:53:04 +01:00
parent b82e938b2c
commit 9d1e78386e
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375
3 changed files with 10 additions and 5 deletions

View File

@ -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 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 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 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 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 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 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 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 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; public abstract fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;

View File

@ -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 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 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 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 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 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 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 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 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; public abstract fun uploadImage (Lnet/mamoe/mirai/utils/ExternalResource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;

View File

@ -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 许可证的约束, 可以在以下链接找到该许可证. * 此源代码的使用受 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. * 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 * https://github.com/mamoe/mirai/blob/dev/LICENSE
*/ */
@file:JvmBlockingBridge
package net.mamoe.mirai.contact.announcement package net.mamoe.mirai.contact.announcement
import kotlinx.coroutines.flow.Flow 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.NotStableForInheritance
import net.mamoe.mirai.utils.Streamable import net.mamoe.mirai.utils.Streamable
import kotlin.jvm.JvmName import kotlin.jvm.JvmName
import kotlin.jvm.JvmSynthetic
/** /**
@ -55,7 +58,6 @@ public interface Announcements : Streamable<OnlineAnnouncement> {
* *
* @see OnlineAnnouncement.delete * @see OnlineAnnouncement.delete
*/ */
@JvmBlockingBridge
public suspend fun delete(fid: String): Boolean public suspend fun delete(fid: String): Boolean
/** /**
@ -64,7 +66,6 @@ public interface Announcements : Streamable<OnlineAnnouncement> {
* @return 返回 `null` 表示不存在该 [fid] 的群公告 * @return 返回 `null` 表示不存在该 [fid] 的群公告
* @throws IllegalStateException 当协议异常时抛出 * @throws IllegalStateException 当协议异常时抛出
*/ */
@JvmBlockingBridge
public suspend fun get(fid: String): OnlineAnnouncement? public suspend fun get(fid: String): OnlineAnnouncement?
/** /**
@ -73,7 +74,6 @@ public interface Announcements : Streamable<OnlineAnnouncement> {
* @throws IllegalStateException 当协议异常时抛出 * @throws IllegalStateException 当协议异常时抛出
* @see Announcement.publishTo * @see Announcement.publishTo
*/ */
@JvmBlockingBridge
public suspend fun publish(announcement: Announcement): OnlineAnnouncement public suspend fun publish(announcement: Announcement): OnlineAnnouncement
/** /**
@ -82,7 +82,6 @@ public interface Announcements : Streamable<OnlineAnnouncement> {
* **注意**: 需要由调用方[关闭][ExternalResource.close] [resource]. * **注意**: 需要由调用方[关闭][ExternalResource.close] [resource].
* @throws IllegalStateException 当协议异常时抛出 * @throws IllegalStateException 当协议异常时抛出
*/ */
@JvmBlockingBridge
public suspend fun uploadImage(resource: ExternalResource): AnnouncementImage public suspend fun uploadImage(resource: ExternalResource): AnnouncementImage
/** /**
@ -96,6 +95,7 @@ public interface Announcements : Streamable<OnlineAnnouncement> {
* @throws IllegalStateException 当协议异常时抛出 * @throws IllegalStateException 当协议异常时抛出
* *
* @see OnlineAnnouncement.members * @see OnlineAnnouncement.members
* @since 2.14
*/ */
public suspend fun members(fid: String, confirmed: Boolean): List<NormalMember> public suspend fun members(fid: String, confirmed: Boolean): List<NormalMember>
@ -119,5 +119,6 @@ public interface Announcements : Streamable<OnlineAnnouncement> {
level = DeprecationLevel.HIDDEN level = DeprecationLevel.HIDDEN
) )
@DeprecatedSinceMirai(hiddenSince = "2.13") @DeprecatedSinceMirai(hiddenSince = "2.13")
@JvmSynthetic // no blocking bridge
public suspend fun asFlow0(): Flow<OnlineAnnouncement> = asFlow() public suspend fun asFlow0(): Flow<OnlineAnnouncement> = asFlow()
} }