From ad465929229a928d418c68b7786c18f95f170eba Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 21 Feb 2013 00:33:29 +0300 Subject: Fix some incorrect chars in browserbox links. --- src/gui/whoisonline.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/gui/whoisonline.cpp') diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp index a194b2ccb..3a03eec13 100644 --- a/src/gui/whoisonline.cpp +++ b/src/gui/whoisonline.cpp @@ -154,10 +154,11 @@ void WhoIsOnline::handleLink(const std::string& link, gcn::MouseEvent *event) { if (chatWindow) { + std::string text = decodeLinkText(link); if (config.getBoolValue("whispertab")) - chatWindow->localChatInput("/q " + link); + chatWindow->localChatInput("/q " + text); else - chatWindow->addInputText("/w \"" + link + "\" "); + chatWindow->addInputText("/w \"" + text + "\" "); } } else if (event->getButton() == gcn::MouseEvent::RIGHT) @@ -169,8 +170,9 @@ void WhoIsOnline::handleLink(const std::string& link, gcn::MouseEvent *event) { if (actorSpriteManager) { + std::string text = decodeLinkText(link); Being* being = actorSpriteManager->findBeingByName( - link, Being::PLAYER); + text, Being::PLAYER); if (being && viewport) { @@ -706,15 +708,15 @@ void WhoIsOnline::updateSize() const std::string WhoIsOnline::prepareNick(std::string nick, int level, std::string color) const { + const char *const text = encodeLinkText(nick).c_str(); if (mShowLevel && level > 1) { - return strprintf("@@%s|##%s%s (%d)@@", nick.c_str(), - color.c_str(), nick.c_str(), level); + return strprintf("@@%s|##%s%s (%d)@@", text, + color.c_str(), text, level); } else { - return strprintf("@@%s|##%s%s@@", nick.c_str(), - color.c_str(), nick.c_str()); + return strprintf("@@%s|##%s%s@@", text, color.c_str(), text); } } @@ -839,6 +841,7 @@ void OnlinePlayer::setText(std::string color) if (mVersion > 0) mText += strprintf(" - %d", mVersion); - mText = strprintf("@@%s|##%s%s %s@@", mNick.c_str(), - color.c_str(), mNick.c_str(), mText.c_str()); + const char *const text = encodeLinkText(mNick).c_str(); + mText = strprintf("@@%s|##%s%s %s@@", text, color.c_str(), + text, mText.c_str()); } -- cgit v1.2.3-60-g2f50