mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-22 13:46:13 +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
|
@Serializable
|
||||||
data class MemberDTO(
|
data class MemberDTO(
|
||||||
override val id: Long,
|
override val id: Long,
|
||||||
val memberName: String = "",
|
val memberName: String,
|
||||||
val permission: MemberPermission,
|
val permission: MemberPermission,
|
||||||
val group: GroupDTO
|
val group: GroupDTO
|
||||||
) : ContactDTO() {
|
) : ContactDTO() {
|
||||||
constructor(member: Member, name: String = "") : this (
|
constructor(member: Member) : this (
|
||||||
member.id, name, member.permission, GroupDTO(member.group)
|
member.id, member.groupCard, member.permission, GroupDTO(member.group)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ sealed class MessageDTO : DTO
|
|||||||
*/
|
*/
|
||||||
suspend fun MessagePacket<*, *>.toDTO(): MessagePacketDTO = when (this) {
|
suspend fun MessagePacket<*, *>.toDTO(): MessagePacketDTO = when (this) {
|
||||||
is FriendMessage -> FriendMessagePacketDTO(QQDTO(sender))
|
is FriendMessage -> FriendMessagePacketDTO(QQDTO(sender))
|
||||||
is GroupMessage -> GroupMessagePacketDTO(MemberDTO(sender, senderName))
|
is GroupMessage -> GroupMessagePacketDTO(MemberDTO(sender))
|
||||||
else -> UnKnownMessagePacketDTO("UnKnown Message Packet")
|
else -> UnKnownMessagePacketDTO("UnKnown Message Packet")
|
||||||
}.apply { messageChain = Array(message.size){ message[it].toDTO() }}
|
}.apply { messageChain = Array(message.size){ message[it].toDTO() }}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user