mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-05 23:50:08 +08:00
Decode html entities when polling announcements
This commit is contained in:
parent
5b170ab63a
commit
3a9889b8c0
@ -296,7 +296,7 @@ internal object AnnouncementProtocol {
|
||||
fun Announcement.toGroupAnnouncement(senderId: Long): GroupAnnouncement {
|
||||
return GroupAnnouncement(
|
||||
sender = senderId,
|
||||
msg = GroupAnnouncementMsg(text = content),
|
||||
msg = GroupAnnouncementMsg(text = content), // 实际测试中发布一个新公告的时候不需要进行 html 转码
|
||||
type = if (parameters.sendToNewMember) 20 else 6,
|
||||
settings = GroupAnnouncementSettings(
|
||||
isShowEditCard = if (parameters.showEditCard) 1 else 0,
|
||||
@ -314,7 +314,7 @@ internal object AnnouncementProtocol {
|
||||
group = group,
|
||||
senderId = sender,
|
||||
sender = group[sender],
|
||||
content = msg.text,
|
||||
content = msg.text.decodeHtmlEscape(),
|
||||
parameters = buildAnnouncementParameters {
|
||||
isPinned = this@toAnnouncement.pinned == 1
|
||||
sendToNewMember = type == 20
|
||||
|
Loading…
Reference in New Issue
Block a user