diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/chat.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index eef1150f..34e7b04b 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -120,22 +120,33 @@ void ChatWindow::chatLog(std::string line, int own, bool ignoreRecord) tmp.nick = ""; tmp.text = line; - // Fix the owner of welcome message. - if (line.substr(0, 7) == "Welcome") { - own = BY_SERVER; - } std::string::size_type pos = line.find(" : "); if (pos != std::string::npos) { tmp.nick = line.substr(0, pos); tmp.text = line.substr(pos + 3); + } else { + // Fix the owner of welcome message. + if (line.substr(0, 7) == "Welcome") + { + own = BY_SERVER; + } } std::string lineColor = "##C"; switch (own) { case BY_GM: - tmp.nick += std::string("Global announcement: "); - lineColor = "##G"; + if (tmp.nick.empty()) + { + tmp.nick = std::string("Global announcement: "); + lineColor = "##G"; + } + else + { + tmp.nick = std::string("Global announcement from " + tmp.nick + + std::string(": ")); + lineColor = "##1"; // Equiv. to BrowserBox::RED + } break; case BY_PLAYER: tmp.nick += CAT_NORMAL; |