diff options
author | Ira Rice <irarice@gmail.com> | 2009-02-16 19:19:12 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-02-16 19:19:12 -0700 |
commit | a40c16cac5356d18aa6fc3f4549ece152713cfe2 (patch) | |
tree | ece97aee33c3cda6d8130c76f266aa9ae7cdf675 /src | |
parent | 31f2c0b41ccc6cfb857c45b23d5c9b1e0c1dc9ac (diff) | |
download | mana-a40c16cac5356d18aa6fc3f4549ece152713cfe2.tar.gz mana-a40c16cac5356d18aa6fc3f4549ece152713cfe2.tar.bz2 mana-a40c16cac5356d18aa6fc3f4549ece152713cfe2.tar.xz mana-a40c16cac5356d18aa6fc3f4549ece152713cfe2.zip |
Moved location of trim checking, since it really should be done after
the recipient nickname is parsed out.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/chat.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index a2ad102d..0e8810ac 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -310,11 +310,6 @@ bool ChatWindow::isInputFocused() void ChatWindow::whisper(const std::string &nick, std::string msg) { - trim(msg); - - if (msg.empty()) - return; - std::string recvnick = ""; if (msg.substr(0, 1) == "\"") @@ -336,6 +331,8 @@ void ChatWindow::whisper(const std::string &nick, std::string msg) } } + trim(msg); + std::string playerName = player_node->getName(); std::string tempNick = recvnick; @@ -349,7 +346,7 @@ void ChatWindow::whisper(const std::string &nick, std::string msg) tempNick[i] = (char) tolower(tempNick[i]); } - if (tempNick.compare(playerName) == 0) + if (tempNick.compare(playerName) == 0 || msg.empty()) return; MessageOut outMsg(mNetwork); |