From 3a9889b8c0b80feecfe724067c17d6de99097cba Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Mon, 12 Jul 2021 15:46:52 +0800 Subject: [PATCH] Decode html entities when polling announcements --- .../kotlin/contact/announcement/AnnouncementsImpl.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/contact/announcement/AnnouncementsImpl.kt b/mirai-core/src/commonMain/kotlin/contact/announcement/AnnouncementsImpl.kt index 5b87fea88..323f9817a 100644 --- a/mirai-core/src/commonMain/kotlin/contact/announcement/AnnouncementsImpl.kt +++ b/mirai-core/src/commonMain/kotlin/contact/announcement/AnnouncementsImpl.kt @@ -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