mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-23 22:30:47 +08:00
Fix missing group owner
This commit is contained in:
parent
f3f8be5fb6
commit
c2d89b611a
@ -40,18 +40,17 @@ data class RawGroupInfo(
|
|||||||
val name: String,
|
val name: String,
|
||||||
val announcement: String,
|
val announcement: String,
|
||||||
/**
|
/**
|
||||||
* 不含群主
|
* 含群主
|
||||||
*/
|
*/
|
||||||
val members: Map<UInt, MemberPermission>
|
val members: Map<UInt, MemberPermission>
|
||||||
) : GroupPacket.GroupPacketResponse {
|
) : GroupPacket.GroupPacketResponse {
|
||||||
suspend inline fun parseBy(group: Group): GroupInfo = group.bot.withSession {
|
suspend inline fun parseBy(group: Group): GroupInfo = group.bot.withSession {
|
||||||
GroupInfo(
|
return GroupInfo(
|
||||||
group,
|
group,
|
||||||
MemberImpl(this@RawGroupInfo.owner.qq(), group, MemberPermission.OWNER),
|
MemberImpl(this@RawGroupInfo.owner.qq(), group, MemberPermission.OWNER),
|
||||||
this@RawGroupInfo.name,
|
this@RawGroupInfo.name,
|
||||||
this@RawGroupInfo.announcement,
|
this@RawGroupInfo.announcement,
|
||||||
ContactList(this@RawGroupInfo.members.mapValuesTo(MutableContactList<Member>()) { MemberImpl(it.key.qq(), group, it.value) }
|
ContactList(this@RawGroupInfo.members.mapValuesTo(MutableContactList()) { MemberImpl(it.key.qq(), group, it.value) })
|
||||||
.apply { put(owner, MemberImpl(owner.qq(), group, MemberPermission.OWNER)) })
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,6 +206,7 @@ object GroupPacket : SessionPacketFactory<GroupPacket.GroupPacketResponse>() {
|
|||||||
}
|
}
|
||||||
members[qq] = permission
|
members[qq] = permission
|
||||||
} while (qq != stop && remaining != 0L)
|
} while (qq != stop && remaining != 0L)
|
||||||
|
members[owner] = MemberPermission.OWNER
|
||||||
return RawGroupInfo(group, owner, groupName, announcement, members)
|
return RawGroupInfo(group, owner, groupName, announcement, members)
|
||||||
/*
|
/*
|
||||||
* 群 Mirai
|
* 群 Mirai
|
||||||
|
Loading…
Reference in New Issue
Block a user