mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Encode HTML messages, reported as bug in Discord
This commit is contained in:
committed by
Mat Sutcliffe
parent
8a2d3458b4
commit
1ceac51771
@@ -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();
|
||||
|
||||
@@ -90,6 +90,9 @@ namespace BlackMisc
|
||||
//! Get ASCII only message
|
||||
QString getAsciiOnlyMessage() const;
|
||||
|
||||
//! Get HTML escaped message
|
||||
QString getHtmlEncodedMessage() const;
|
||||
|
||||
//! Empty message
|
||||
bool isEmpty() const { return m_message.isEmpty(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user