mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-01 03:50:18 +08:00
Add equals
This commit is contained in:
parent
22f2c5087e
commit
69f1ee2cf2
@ -18,16 +18,11 @@ object MiraiHttpAPIServer {
|
||||
@UseExperimental(KtorExperimentalAPI::class)
|
||||
fun start(
|
||||
port: Int = 8080,
|
||||
authKey: String? = null,
|
||||
authKey: String,
|
||||
callback: (() -> Unit)? = null
|
||||
) {
|
||||
authKey?.apply {
|
||||
if (authKey.length in 8..128) {
|
||||
SessionManager.authKey = authKey
|
||||
} else {
|
||||
logger.error("Expected authKey length is between 8 to 128")
|
||||
}
|
||||
}
|
||||
require(authKey.length in 8..128) { "Expected authKey length is between 8 to 128" }
|
||||
SessionManager.authKey = authKey
|
||||
|
||||
// TODO: start是无阻塞的,理应获取启动状态后再执行后续代码
|
||||
try {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.mamoe.mirai.qqandroid
|
||||
|
||||
import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.launch
|
||||
import net.mamoe.mirai.contact.*
|
||||
import net.mamoe.mirai.data.FriendNameRemark
|
||||
@ -60,6 +59,9 @@ internal class QQImpl(bot: QQAndroidBot, override val coroutineContext: Coroutin
|
||||
TODO("not implemented")
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other is QQ && other.id == this.id
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -108,6 +110,9 @@ internal class MemberImpl(
|
||||
return mute(0)
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other is Member && other.id == this.id
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -325,4 +330,8 @@ internal class GroupImpl(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other is Group && other.id == this.id
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user