diff --git a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/ContactJavaHappyAPI.kt b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/ContactJavaHappyAPI.kt index a131fd174..515a87d03 100644 --- a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/ContactJavaHappyAPI.kt +++ b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/ContactJavaHappyAPI.kt @@ -58,13 +58,13 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(EventCancelledException::class, IllegalStateException::class) @JvmName("sendMessage") - open fun __sendMessageBlockingForJava__(message: Message) { - runBlocking { sendMessage(message) } + open fun __sendMessageBlockingForJava__(message: Message): MessageReceipt { + return runBlocking { sendMessage(message) } } @JvmName("sendMessage") - open fun __sendMessageBlockingForJava__(message: String) { - runBlocking { sendMessage(message) } + open fun __sendMessageBlockingForJava__(message: String): MessageReceipt { + return runBlocking { sendMessage(message) } } /** @@ -78,8 +78,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: ExternalImage) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: ExternalImage): Image { + return runBlocking { uploadImage(image) } } /** @@ -88,8 +88,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: URL) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: URL): Image { + return runBlocking { uploadImage(image) } } /** @@ -98,8 +98,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: InputStream) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: InputStream): Image { + return runBlocking { uploadImage(image) } } /** @@ -108,8 +108,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: Input) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: Input): Image { + return runBlocking { uploadImage(image) } } /** @@ -118,8 +118,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: File) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: File): Image { + return runBlocking { uploadImage(image) } } /** @@ -128,8 +128,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: Bitmap) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: Bitmap): Image { + return runBlocking { uploadImage(image) } } /** @@ -236,8 +236,8 @@ actual abstract class MemberJavaHappyAPI : QQ() { * @throws PermissionDeniedException 无权限修改时 */ @JvmName("mute") - open fun __muteBlockingForJava__(durationSeconds: Int) { - runBlocking { mute(durationSeconds) } + open fun __muteBlockingForJava__(seconds: Int) { + return runBlocking { mute(seconds) } } /** @@ -250,7 +250,7 @@ actual abstract class MemberJavaHappyAPI : QQ() { */ @JvmName("unmute") open fun __unmuteBlockingForJava__() { - runBlocking { unmute() } + return runBlocking { unmute() } } /** @@ -263,7 +263,7 @@ actual abstract class MemberJavaHappyAPI : QQ() { */ @JvmName("kick") open fun __kickBlockingForJava__(message: String) { - runBlocking { kick() } + return runBlocking { kick() } } /** @@ -297,8 +297,8 @@ actual abstract class MemberJavaHappyAPI : QQ() { * @throws PermissionDeniedException 无权限修改时 */ @JvmName("muteAsync") - open fun __muteAsyncForJava__(durationSeconds: Int): Future { - return future { mute(durationSeconds) } + open fun __muteAsyncForJava__(seconds: Int): Future { + return future { mute(seconds) } } /** diff --git a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/contact/ContactJavaHappyAPI.kt b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/contact/ContactJavaHappyAPI.kt index 8f37f7132..e5169ab98 100644 --- a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/contact/ContactJavaHappyAPI.kt +++ b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/contact/ContactJavaHappyAPI.kt @@ -58,13 +58,13 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(EventCancelledException::class, IllegalStateException::class) @JvmName("sendMessage") - open fun __sendMessageBlockingForJava__(message: Message) { - runBlocking { sendMessage(message) } + open fun __sendMessageBlockingForJava__(message: Message): MessageReceipt { + return runBlocking { sendMessage(message) } } @JvmName("sendMessage") - open fun __sendMessageBlockingForJava__(message: String) { - runBlocking { sendMessage(message) } + open fun __sendMessageBlockingForJava__(message: String): MessageReceipt { + return runBlocking { sendMessage(message) } } /** @@ -78,8 +78,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: ExternalImage) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: ExternalImage): Image { + return runBlocking { uploadImage(image) } } /** @@ -88,8 +88,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: URL) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: URL): Image { + return runBlocking { uploadImage(image) } } /** @@ -98,8 +98,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: InputStream) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: InputStream): Image { + return runBlocking { uploadImage(image) } } /** @@ -108,8 +108,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: Input) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: Input): Image { + return runBlocking { uploadImage(image) } } /** @@ -118,8 +118,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: File) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: File): Image { + return runBlocking { uploadImage(image) } } /** @@ -128,8 +128,8 @@ actual abstract class ContactJavaHappyAPI { */ @Throws(OverFileSizeMaxException::class) @JvmName("uploadImage") - open fun __uploadImageBlockingForJava__(image: BufferedImage) { - runBlocking { uploadImage(image) } + open fun __uploadImageBlockingForJava__(image: BufferedImage): Image { + return runBlocking { uploadImage(image) } } /**