Skip to content

Commit

Permalink
Merge pull request #7956 from spycrab/fix_np_chat_escape
Browse files Browse the repository at this point in the history
Qt/NetPlayDialog: Fix messages being html-escaped for NetPlay Chat
  • Loading branch information
JosJuice committed Apr 3, 2019
2 parents 923151e + 628d72c commit bfde5b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Source/Core/DolphinQt/NetPlay/NetPlayDialog.cpp
Expand Up @@ -361,9 +361,9 @@ void NetPlayDialog::SendMessage(const std::string& msg)
{
Settings::Instance().GetNetPlayClient()->SendChatMessage(msg);

DisplayMessage(QStringLiteral("%1: %2").arg(QString::fromStdString(m_nickname).toHtmlEscaped(),
QString::fromStdString(msg).toHtmlEscaped()),
"");
DisplayMessage(
QStringLiteral("%1: %2").arg(QString::fromStdString(m_nickname), QString::fromStdString(msg)),
"");
}

void NetPlayDialog::OnChat()
Expand Down Expand Up @@ -768,8 +768,8 @@ void NetPlayDialog::Update()
void NetPlayDialog::DisplayMessage(const QString& msg, const std::string& color, int duration)
{
QueueOnObject(m_chat_edit, [this, color, msg] {
m_chat_edit->append(
QStringLiteral("<font color='%1'>%2</font>").arg(QString::fromStdString(color), msg));
m_chat_edit->append(QStringLiteral("<font color='%1'>%2</font>")
.arg(QString::fromStdString(color), msg.toHtmlEscaped()));
});

QColor c(color.empty() ? QStringLiteral("white") : QString::fromStdString(color));
Expand All @@ -782,7 +782,7 @@ void NetPlayDialog::DisplayMessage(const QString& msg, const std::string& color,

void NetPlayDialog::AppendChat(const std::string& msg)
{
DisplayMessage(QString::fromStdString(msg).toHtmlEscaped(), "");
DisplayMessage(QString::fromStdString(msg), "");
QApplication::alert(this);
}

Expand Down

0 comments on commit bfde5b9

Please sign in to comment.