Encode HTML messages, reported as bug in Discord

This commit is contained in:
Klaus Basan
2019-10-09 00:21:40 +02:00
committed by Mat Sutcliffe
parent 8a2d3458b4
commit 1ceac51771
4 changed files with 12 additions and 3 deletions

View File

@@ -164,6 +164,12 @@ namespace BlackMisc
return asciiOnlyString(simplifyAccents(m_message));
}
QString CTextMessage::getHtmlEncodedMessage() const
{
if (m_message.isEmpty()) { return {}; }
return m_message.toHtmlEscaped();
}
void CTextMessage::setMessage(const QString &message)
{
m_message = message.simplified().trimmed();