From adfacb195ba653b63fec08200d0535604d45e20e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 26 Mar 2011 20:04:40 +0200 Subject: Add option to chat context menu to remove nicks. Usefull for example for tmw guild bot. --- src/gui/chat.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/gui/chat.cpp') diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 8923b40f4..a72d562c2 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -904,7 +904,28 @@ void ChatWindow::whisper(const std::string &nick, } else { - tab->chatLog(nick, mes); + if (tab->getRemoveNames()) + { + std::string msg = mes; + std::string nick2; + int idx = mes.find(":"); + if (idx > 0) + { + nick2 = msg.substr(0, idx); + msg = msg.substr(idx + 1); + trim(nick2); + trim(msg); + tab->chatLog(nick2, msg); + } + else + { + tab->chatLog(nick, mes); + } + } + else + { + tab->chatLog(nick, mes); + } player_node->afkRespond(tab, nick); } } -- cgit v1.2.3-60-g2f50