Decode html entities when polling announcements

This commit is contained in:
Karlatemp 2021-07-12 15:46:52 +08:00 committed by Him188
parent 5b170ab63a
commit 3a9889b8c0

View File

@ -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