Commit b26b3bbf authored by Him188's avatar Him188

Fix `MemberImpl.equals`

parent 03c61432
...@@ -166,7 +166,7 @@ internal class QQImpl( ...@@ -166,7 +166,7 @@ internal class QQImpl(
} }
@Suppress("MemberVisibilityCanBePrivate", "DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE") @Suppress("MemberVisibilityCanBePrivate")
internal class MemberImpl( internal class MemberImpl(
qq: QQImpl, qq: QQImpl,
group: GroupImpl, group: GroupImpl,
...@@ -286,6 +286,20 @@ internal class MemberImpl( ...@@ -286,6 +286,20 @@ internal class MemberImpl(
} }
} }
override fun hashCode(): Int {
var result = bot.hashCode()
result = 31 * result + id.hashCode()
return result
}
@Suppress("DuplicatedCode")
override fun equals(other: Any?): Boolean { // 不要删除. trust me
if (this === other) return true
if (other !is Contact) return false
if (this::class != other::class) return false
return this.id == other.id && this.bot == other.bot
}
override fun toString(): String { override fun toString(): String {
return "Member($id)" return "Member($id)"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment