mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
Merge pull request #7956 from spycrab/fix_np_chat_escape
Qt/NetPlayDialog: Fix messages being html-escaped for NetPlay Chat
This commit is contained in:
commit
bfde5b931e
@ -361,9 +361,9 @@ void NetPlayDialog::SendMessage(const std::string& msg)
|
|||||||
{
|
{
|
||||||
Settings::Instance().GetNetPlayClient()->SendChatMessage(msg);
|
Settings::Instance().GetNetPlayClient()->SendChatMessage(msg);
|
||||||
|
|
||||||
DisplayMessage(QStringLiteral("%1: %2").arg(QString::fromStdString(m_nickname).toHtmlEscaped(),
|
DisplayMessage(
|
||||||
QString::fromStdString(msg).toHtmlEscaped()),
|
QStringLiteral("%1: %2").arg(QString::fromStdString(m_nickname), QString::fromStdString(msg)),
|
||||||
"");
|
"");
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetPlayDialog::OnChat()
|
void NetPlayDialog::OnChat()
|
||||||
@ -768,8 +768,8 @@ void NetPlayDialog::Update()
|
|||||||
void NetPlayDialog::DisplayMessage(const QString& msg, const std::string& color, int duration)
|
void NetPlayDialog::DisplayMessage(const QString& msg, const std::string& color, int duration)
|
||||||
{
|
{
|
||||||
QueueOnObject(m_chat_edit, [this, color, msg] {
|
QueueOnObject(m_chat_edit, [this, color, msg] {
|
||||||
m_chat_edit->append(
|
m_chat_edit->append(QStringLiteral("<font color='%1'>%2</font>")
|
||||||
QStringLiteral("<font color='%1'>%2</font>").arg(QString::fromStdString(color), msg));
|
.arg(QString::fromStdString(color), msg.toHtmlEscaped()));
|
||||||
});
|
});
|
||||||
|
|
||||||
QColor c(color.empty() ? QStringLiteral("white") : QString::fromStdString(color));
|
QColor c(color.empty() ? QStringLiteral("white") : QString::fromStdString(color));
|
||||||
@ -782,7 +782,7 @@ void NetPlayDialog::DisplayMessage(const QString& msg, const std::string& color,
|
|||||||
|
|
||||||
void NetPlayDialog::AppendChat(const std::string& msg)
|
void NetPlayDialog::AppendChat(const std::string& msg)
|
||||||
{
|
{
|
||||||
DisplayMessage(QString::fromStdString(msg).toHtmlEscaped(), "");
|
DisplayMessage(QString::fromStdString(msg), "");
|
||||||
QApplication::alert(this);
|
QApplication::alert(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user