From c2d89b611aff625a96c1433c4c884fabb47aae81 Mon Sep 17 00:00:00 2001 From: Him188 Date: Wed, 4 Dec 2019 20:43:54 +0800 Subject: [PATCH] Fix missing group owner --- .../network/protocol/tim/packet/action/GroupPacket.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/action/GroupPacket.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/action/GroupPacket.kt index e09fc4d2f..fdf8659eb 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/action/GroupPacket.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/action/GroupPacket.kt @@ -40,18 +40,17 @@ data class RawGroupInfo( val name: String, val announcement: String, /** - * 不含群主 + * 含群主 */ val members: Map ) : GroupPacket.GroupPacketResponse { suspend inline fun parseBy(group: Group): GroupInfo = group.bot.withSession { - GroupInfo( + return GroupInfo( group, MemberImpl(this@RawGroupInfo.owner.qq(), group, MemberPermission.OWNER), this@RawGroupInfo.name, this@RawGroupInfo.announcement, - ContactList(this@RawGroupInfo.members.mapValuesTo(MutableContactList()) { MemberImpl(it.key.qq(), group, it.value) } - .apply { put(owner, MemberImpl(owner.qq(), group, MemberPermission.OWNER)) }) + ContactList(this@RawGroupInfo.members.mapValuesTo(MutableContactList()) { MemberImpl(it.key.qq(), group, it.value) }) ) } } @@ -207,6 +206,7 @@ object GroupPacket : SessionPacketFactory() { } members[qq] = permission } while (qq != stop && remaining != 0L) + members[owner] = MemberPermission.OWNER return RawGroupInfo(group, owner, groupName, announcement, members) /* * 群 Mirai