From 73571695605e233c907c8ac2f377e456dea0200d Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 10 Apr 2020 13:42:04 +0800 Subject: [PATCH] Fix build --- .../net/mamoe/mirai/contact/ContactJavaFriendlyAPI.kt | 9 +++++---- .../androidMain/kotlin/net/mamoe/mirai/contact/Group.kt | 1 + .../androidMain/kotlin/net/mamoe/mirai/contact/Member.kt | 1 + .../src/androidMain/kotlin/net/mamoe/mirai/contact/QQ.kt | 1 + .../kotlin/net/mamoe/mirai/message/MessagePacket.kt | 1 + .../net/mamoe/mirai/message/SendImageUtilsAndroid.kt | 2 ++ .../kotlin/net/mamoe/mirai/message/MessagePacket.kt | 1 + .../kotlin/net/mamoe/mirai/message/SendImageUtilsJvm.kt | 2 ++ 8 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/ContactJavaFriendlyAPI.kt b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/ContactJavaFriendlyAPI.kt index f35bc1497..8dddfc232 100644 --- a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/ContactJavaFriendlyAPI.kt +++ b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/ContactJavaFriendlyAPI.kt @@ -18,6 +18,7 @@ import net.mamoe.mirai.event.events.* import net.mamoe.mirai.event.events.MessageSendEvent.FriendMessageSendEvent import net.mamoe.mirai.event.events.MessageSendEvent.GroupMessageSendEvent import net.mamoe.mirai.future +import net.mamoe.mirai.message.MessageReceipt import net.mamoe.mirai.message.data.Image import net.mamoe.mirai.message.data.Message import net.mamoe.mirai.message.uploadImage @@ -61,14 +62,14 @@ actual abstract class ContactJavaFriendlyAPI { */ @Throws(EventCancelledException::class, IllegalStateException::class) @JvmName("sendMessage") - open fun __sendMessageBlockingForJava__(message: Message): MessageReceipt { + open fun __sendMessageBlockingForJava__(message: Message): MessageReceipt<@JvmWildcard Contact> { return runBlocking { sendMessage(message) } } @JvmName("sendMessage") - open fun __sendMessageBlockingForJava__(message: String): MessageReceipt { + open fun __sendMessageBlockingForJava__(message: String): MessageReceipt<@JvmWildcard Contact> { return runBlocking { sendMessage(message) } } @@ -142,7 +143,7 @@ actual abstract class ContactJavaFriendlyAPI { * @see Contact.sendMessage */ @JvmName("sendMessageAsync") - open fun __sendMessageAsyncForJava__(message: Message): Future> { + open fun __sendMessageAsyncForJava__(message: Message): Future> { return future { sendMessage(message) } } @@ -151,7 +152,7 @@ actual abstract class ContactJavaFriendlyAPI { * @see Contact.sendMessage */ @JvmName("sendMessageAsync") - open fun __sendMessageAsyncForJava__(message: String): Future> { + open fun __sendMessageAsyncForJava__(message: String): Future> { return future { sendMessage(message) } } diff --git a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Group.kt b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Group.kt index 51e2e7cf2..92014d246 100644 --- a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Group.kt +++ b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Group.kt @@ -16,6 +16,7 @@ import net.mamoe.mirai.data.MemberInfo import net.mamoe.mirai.event.events.* import net.mamoe.mirai.event.events.MessageSendEvent.FriendMessageSendEvent import net.mamoe.mirai.event.events.MessageSendEvent.GroupMessageSendEvent +import net.mamoe.mirai.message.MessageReceipt import net.mamoe.mirai.message.data.Message import net.mamoe.mirai.message.data.OfflineGroupImage import net.mamoe.mirai.utils.ExternalImage diff --git a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Member.kt b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Member.kt index 70e803f95..2dcc96814 100644 --- a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Member.kt +++ b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/Member.kt @@ -16,6 +16,7 @@ import net.mamoe.mirai.JavaFriendlyAPI import net.mamoe.mirai.event.events.* import net.mamoe.mirai.event.events.MessageSendEvent.FriendMessageSendEvent import net.mamoe.mirai.event.events.MessageSendEvent.GroupMessageSendEvent +import net.mamoe.mirai.message.MessageReceipt import net.mamoe.mirai.message.data.Message import net.mamoe.mirai.utils.MiraiInternalAPI import net.mamoe.mirai.utils.WeakRefProperty diff --git a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/QQ.kt b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/QQ.kt index 8b54cb8c6..093040808 100644 --- a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/QQ.kt +++ b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/contact/QQ.kt @@ -12,6 +12,7 @@ import net.mamoe.mirai.event.events.EventCancelledException import net.mamoe.mirai.event.events.ImageUploadEvent import net.mamoe.mirai.event.events.MessageSendEvent.FriendMessageSendEvent import net.mamoe.mirai.event.events.MessageSendEvent.GroupMessageSendEvent +import net.mamoe.mirai.message.MessageReceipt import net.mamoe.mirai.message.data.Message import net.mamoe.mirai.message.data.OfflineFriendImage import net.mamoe.mirai.utils.ExternalImage diff --git a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/message/MessagePacket.kt b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/message/MessagePacket.kt index 3c317907d..a41a2420b 100644 --- a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/message/MessagePacket.kt +++ b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/message/MessagePacket.kt @@ -13,6 +13,7 @@ package net.mamoe.mirai.message import android.graphics.Bitmap import kotlinx.io.core.Input +import net.mamoe.mirai.contact.Contact import net.mamoe.mirai.contact.QQ import net.mamoe.mirai.message.data.Image import net.mamoe.mirai.utils.MiraiInternalAPI diff --git a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/message/SendImageUtilsAndroid.kt b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/message/SendImageUtilsAndroid.kt index 552230359..d38892940 100644 --- a/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/message/SendImageUtilsAndroid.kt +++ b/mirai-core/src/androidMain/kotlin/net/mamoe/mirai/message/SendImageUtilsAndroid.kt @@ -15,8 +15,10 @@ import android.graphics.Bitmap import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import kotlinx.io.core.Input +import net.mamoe.mirai.contact.Contact import net.mamoe.mirai.message.data.Image import net.mamoe.mirai.utils.OverFileSizeMaxException +import net.mamoe.mirai.utils.sendTo import net.mamoe.mirai.utils.toExternalImage import net.mamoe.mirai.utils.upload import java.io.File diff --git a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/MessagePacket.kt b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/MessagePacket.kt index f2f1c658a..249cec608 100644 --- a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/MessagePacket.kt +++ b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/MessagePacket.kt @@ -15,6 +15,7 @@ import kotlinx.coroutines.io.ByteWriteChannel import kotlinx.io.core.Input import kotlinx.io.core.Output import kotlinx.io.core.use +import net.mamoe.mirai.contact.Contact import net.mamoe.mirai.contact.QQ import net.mamoe.mirai.message.data.Image import net.mamoe.mirai.utils.MiraiExperimentalAPI diff --git a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/SendImageUtilsJvm.kt b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/SendImageUtilsJvm.kt index aaf244b12..31bfecdeb 100644 --- a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/SendImageUtilsJvm.kt +++ b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/message/SendImageUtilsJvm.kt @@ -14,9 +14,11 @@ package net.mamoe.mirai.message import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import kotlinx.io.core.Input +import net.mamoe.mirai.contact.Contact import net.mamoe.mirai.message.data.Image import net.mamoe.mirai.message.data.OfflineImage import net.mamoe.mirai.utils.OverFileSizeMaxException +import net.mamoe.mirai.utils.sendTo import net.mamoe.mirai.utils.toExternalImage import net.mamoe.mirai.utils.upload import java.awt.image.BufferedImage