mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-04 08:59:51 +08:00
http-api use member group card instead of sender name
This commit is contained in:
parent
fa515ed3b9
commit
75d82457ea
@ -25,12 +25,12 @@ data class QQDTO(
|
||||
@Serializable
|
||||
data class MemberDTO(
|
||||
override val id: Long,
|
||||
val memberName: String = "",
|
||||
val memberName: String,
|
||||
val permission: MemberPermission,
|
||||
val group: GroupDTO
|
||||
) : ContactDTO() {
|
||||
constructor(member: Member, name: String = "") : this (
|
||||
member.id, name, member.permission, GroupDTO(member.group)
|
||||
constructor(member: Member) : this (
|
||||
member.id, member.groupCard, member.permission, GroupDTO(member.group)
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ sealed class MessageDTO : DTO
|
||||
*/
|
||||
suspend fun MessagePacket<*, *>.toDTO(): MessagePacketDTO = when (this) {
|
||||
is FriendMessage -> FriendMessagePacketDTO(QQDTO(sender))
|
||||
is GroupMessage -> GroupMessagePacketDTO(MemberDTO(sender, senderName))
|
||||
is GroupMessage -> GroupMessagePacketDTO(MemberDTO(sender))
|
||||
else -> UnKnownMessagePacketDTO("UnKnown Message Packet")
|
||||
}.apply { messageChain = Array(message.size){ message[it].toDTO() }}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user