mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-05 23:50:08 +08:00
* Fix #1674, apply right nick and remark impl for contact design * Fix build, add missed member impl * Fix wrong delegate in AbstractMember impl Co-authored-by: sandtechnology <a1294790523@hotmail.com> Co-authored-by: Him188 <him188@mamoe.net>
This commit is contained in:
parent
736f52275f
commit
4e3873c3d3
@ -21,8 +21,12 @@ internal sealed class AbstractMember(
|
||||
parentCoroutineContext: CoroutineContext,
|
||||
memberInfo: MemberInfo,
|
||||
) : AbstractUser(group.bot, parentCoroutineContext, memberInfo), Member {
|
||||
|
||||
final override val info: MemberInfoImpl = memberInfo.cast()
|
||||
|
||||
override var nick: String by info::nick
|
||||
override var remark: String by info::remark
|
||||
|
||||
override val nameCard: String get() = info.nameCard
|
||||
override val specialTitle: String get() = info.specialTitle
|
||||
override var permission: MemberPermission by info::permission
|
||||
|
@ -62,8 +62,8 @@ internal sealed class AbstractUser(
|
||||
) : User, AbstractContact(bot, parentCoroutineContext) {
|
||||
|
||||
final override val id: Long = userInfo.uin
|
||||
final override var nick: String = userInfo.nick
|
||||
final override val remark: String = userInfo.remark
|
||||
abstract override val nick: String
|
||||
abstract override val remark: String
|
||||
|
||||
val messageSeq = AtomicIntSeq.forMessageSeq()
|
||||
val fragmentedMessageMerger = C2CPkgMsgParsingCache()
|
||||
|
@ -63,6 +63,8 @@ internal class FriendImpl(
|
||||
parentCoroutineContext: CoroutineContext,
|
||||
override val info: FriendInfoImpl,
|
||||
) : Friend, AbstractUser(bot, parentCoroutineContext, info) {
|
||||
override var nick: String by info::nick
|
||||
override var remark: String by info::remark
|
||||
override suspend fun delete() {
|
||||
check(bot.friends[id] != null) {
|
||||
"Friend $id had already been deleted"
|
||||
|
@ -48,6 +48,8 @@ internal class StrangerImpl(
|
||||
parentCoroutineContext: CoroutineContext,
|
||||
override val info: StrangerInfo,
|
||||
) : Stranger, AbstractUser(bot, parentCoroutineContext, info) {
|
||||
override val nick: String by info::nick
|
||||
override val remark: String by info::remark
|
||||
override suspend fun delete() {
|
||||
check(bot.strangers[this.id] != null) {
|
||||
"Stranger ${this.id} had already been deleted"
|
||||
|
Loading…
Reference in New Issue
Block a user