From a40c16cac5356d18aa6fc3f4549ece152713cfe2 Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 16 Feb 2009 19:19:12 -0700 Subject: Moved location of trim checking, since it really should be done after the recipient nickname is parsed out. Signed-off-by: Ira Rice --- src/gui/chat.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/gui') 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); -- cgit v1.2.3-70-g09d2