diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/At.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/At.kt index 949b7e6ae..c08baf3b4 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/At.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/At.kt @@ -34,10 +34,6 @@ class At @MiraiInternalAPI constructor(val target: Long, val display: String) : companion object Key : Message.Key - override fun eq(other: Message): Boolean { - return other is At && other.target == this.target - } - // 自动为消息补充 " " override fun followedBy(tail: Message): MessageChain { diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Face.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Face.kt index 69ab4596c..0578b7c9d 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Face.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Face.kt @@ -167,8 +167,4 @@ class Face(val id: Int) : Message { const val shouqiang: Int = 169 const val qingwa: Int = 170 } - - override fun eq(other: Message): Boolean { - return other is Face && other.id == this.id - } } \ No newline at end of file diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt index f4e6dd98f..d11c80488 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/Image.kt @@ -49,11 +49,6 @@ sealed class Image : Message { final override fun toString(): String { return "[mirai:$imageId]" } - - final override fun eq(other: Message): Boolean { - return if (other is Image) return other.imageId == this.imageId - else this.toString() == other.toString() - } } abstract class CustomFace : Image() { diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt index f66376bb3..cf6420cc3 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt @@ -57,12 +57,6 @@ interface MessageChain : Message, MutableList { * @param key 由各个类型消息的伴生对象持有. 如 [PlainText.Key] */ operator fun get(key: Message.Key): M = first(key) - - override fun eq(other: Message): Boolean { - if (other is MessageChain && other.size != this.size) - return false - return this.toString() == other.toString() - } } /** diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/PlainText.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/PlainText.kt index e7dbe30ee..d13061536 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/PlainText.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/PlainText.kt @@ -25,13 +25,6 @@ inline class PlainText(val stringValue: String) : Message { override fun toString(): String = stringValue companion object Key : Message.Key - - override fun eq(other: Message): Boolean { - if (other is MessageChain) { - return other eq this.toString() - } - return other is PlainText && other.stringValue == this.stringValue - } } /** diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/XML.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/XML.kt index d8805a6d7..27a4829d3 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/XML.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/XML.kt @@ -27,10 +27,6 @@ inline class XMLMessage(val stringValue: String) : Message, SingleOnly { override fun followedBy(tail: Message): Nothing = error("XMLMessage Message cannot be followed") override fun toString(): String = stringValue - - override fun eq(other: Message): Boolean { - return other is XMLMessage && other.stringValue == this.stringValue - } } /**