diff options
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 30511ef9..46611b78 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -426,6 +426,11 @@ void ChatWindow::whisper(std::string nick, std::string mes, bool own) ChatTab *tab = mWhispers[tempNick]; + if (!tab && config.getValue("whispertab", false)) + { + tab = addWhisperTab(nick); + } + if (tab) { if (own) @@ -447,7 +452,7 @@ void ChatWindow::whisper(std::string nick, std::string mes, bool own) } } -bool ChatWindow::addWhisperTab(std::string nick) +ChatTab *ChatWindow::addWhisperTab(std::string nick) { std::string playerName = player_node->getName(); std::string tempNick = nick; @@ -456,9 +461,7 @@ bool ChatWindow::addWhisperTab(std::string nick) toLower(tempNick); if (mWhispers[tempNick] || tempNick.compare(playerName) == 0) - return false; - - mWhispers[tempNick] = new WhisperTab(nick); + return NULL; - return true; + return mWhispers[tempNick] = new WhisperTab(nick); } |