Binary compatibility

This commit is contained in:
Him188 2020-03-22 23:42:46 +08:00
parent 4850666028
commit f9a296331d
14 changed files with 30 additions and 2 deletions

View File

@ -1,5 +1,5 @@
#Thu Feb 06 14:10:33 CST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.2-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists

View File

@ -77,7 +77,7 @@ internal class QQImpl(
}
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
override suspend fun sendMessage(message: MessageChain): MessageReceipt<QQ> {
override suspend fun sendMessage(message: MessageChain) {
return this.sendMessage(message as Message)
}

View File

@ -67,6 +67,7 @@ actual abstract class Contact : CoroutineScope, ContactJavaHappyAPI() {
@JvmSynthetic
actual abstract suspend fun sendMessage(message: Message): MessageReceipt<out Contact>
@JvmName("sendMessageSuspend")
@JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract suspend fun sendMessage(message: MessageChain): MessageReceipt<out Contact>

View File

@ -182,6 +182,7 @@ actual abstract class Group : Contact(), CoroutineScope {
@JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group>
@JvmName("sendMessageSuspend")
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
@JvmSynthetic
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group>

View File

@ -18,6 +18,7 @@ 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.MessageChain
import net.mamoe.mirai.utils.MiraiInternalAPI
import net.mamoe.mirai.utils.WeakRefProperty
@ -120,6 +121,11 @@ actual abstract class Member : MemberJavaHappyAPI() {
@JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member>
@JvmName("sendMessageSuspend")
@JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>
/**
* 踢出该成员.
*

View File

@ -91,6 +91,7 @@ actual abstract class QQ : Contact(), CoroutineScope {
@JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<out QQ>
@JvmName("sendMessageSuspend")
@JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>

View File

@ -71,6 +71,7 @@ expect abstract class Contact() : CoroutineScope, ContactJavaHappyAPI {
@JvmSynthetic
abstract suspend fun sendMessage(message: Message): MessageReceipt<out Contact>
@JvmName("sendMessageSuspend")
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
@JvmSynthetic
abstract suspend fun sendMessage(message: MessageChain): MessageReceipt<out Contact>

View File

@ -183,6 +183,7 @@ expect abstract class Group() : Contact, CoroutineScope {
@JvmSynthetic
abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group>
@JvmName("sendMessageSuspend")
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
@JvmSynthetic
abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group>

View File

@ -16,6 +16,7 @@ import net.mamoe.mirai.JavaHappyAPI
import net.mamoe.mirai.event.events.*
import net.mamoe.mirai.message.MessageReceipt
import net.mamoe.mirai.message.data.Message
import net.mamoe.mirai.message.data.MessageChain
import net.mamoe.mirai.utils.MiraiInternalAPI
import net.mamoe.mirai.utils.WeakRefProperty
import kotlin.jvm.JvmName
@ -147,6 +148,12 @@ expect abstract class Member() : MemberJavaHappyAPI {
@JvmSynthetic
@JvmName("sendMessageSuspend")
abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member>
@JvmName("sendMessageSuspend")
@JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>
}
/**

View File

@ -101,6 +101,7 @@ expect abstract class QQ() : Contact, CoroutineScope {
@JvmName("sendMessageSuspend")
abstract override suspend fun sendMessage(message: Message): MessageReceipt<out QQ>
@JvmName("sendMessageSuspend")
@JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>

View File

@ -66,6 +66,7 @@ actual abstract class Contact : CoroutineScope, ContactJavaHappyAPI() {
@JvmSynthetic
actual abstract suspend fun sendMessage(message: Message): MessageReceipt<out Contact>
@JvmName("sendMessageSuspend")
@JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract suspend fun sendMessage(message: MessageChain): MessageReceipt<out Contact>

View File

@ -183,6 +183,7 @@ actual abstract class Group : Contact(), CoroutineScope {
@JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Group>
@JvmName("sendMessageSuspend")
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
@JvmSynthetic
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<Group>

View File

@ -18,6 +18,7 @@ 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.MessageChain
import net.mamoe.mirai.utils.MiraiInternalAPI
import net.mamoe.mirai.utils.WeakRefProperty
@ -132,6 +133,11 @@ actual abstract class Member : MemberJavaHappyAPI() {
@JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<Member>
@JvmName("sendMessageSuspend")
@JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>
/**
* 当且仅当 `[other] is [Member] && [other].id == this.id && [other].group == this.group` 时为 true
*/

View File

@ -91,6 +91,7 @@ actual abstract class QQ : Contact(), CoroutineScope {
@JvmSynthetic
actual abstract override suspend fun sendMessage(message: Message): MessageReceipt<out QQ>
@JvmName("sendMessageSuspend")
@JvmSynthetic
@Deprecated("for binary compatibility", level = DeprecationLevel.HIDDEN)
actual abstract override suspend fun sendMessage(message: MessageChain): MessageReceipt<out QQ>