summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-29 08:55:59 -0700
committerIra Rice <irarice@gmail.com>2009-01-29 08:55:59 -0700
commit68f3b73a82999b8ee8c7937b9da8060af1f3b691 (patch)
tree41ccc60db4cf97c0f77beabe1459a2e0d3749e62 /src/gui
parent0a2883b61472c5dbcd419d033bd8792c335dc175 (diff)
downloadmana-client-68f3b73a82999b8ee8c7937b9da8060af1f3b691.tar.gz
mana-client-68f3b73a82999b8ee8c7937b9da8060af1f3b691.tar.bz2
mana-client-68f3b73a82999b8ee8c7937b9da8060af1f3b691.tar.xz
mana-client-68f3b73a82999b8ee8c7937b9da8060af1f3b691.zip
If an item link isn't found, don't treat it as a link.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chat.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 068fad08..d790d292 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -376,14 +376,7 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg)
std::string temp = msg.substr(start+1, end - start - 1);
- while (temp[0] == ' ')
- {
- temp = temp.substr(1, temp.size());
- }
- while (temp[temp.size()] == ' ')
- {
- temp = temp.substr(0, temp.size() - 1);
- }
+ trim(temp);
for (unsigned int i = 0; i < temp.size(); i++)
{
@@ -391,10 +384,13 @@ void ChatWindow::chatSend(const std::string &nick, std::string msg)
}
const ItemInfo itemInfo = ItemDB::get(temp);
- msg.insert(end, "@@");
- msg.insert(start+1, "|");
- msg.insert(start+1, toString(itemInfo.getId()));
- msg.insert(start+1, "@@");
+ if (itemInfo.getName() != _("Unknown item"))
+ {
+ msg.insert(end, "@@");
+ msg.insert(start+1, "|");
+ msg.insert(start+1, toString(itemInfo.getId()));
+ msg.insert(start+1, "@@");
+ }
}
start = msg.find('[', start + 1);
}