summaryrefslogtreecommitdiff
path: root/src/gui/chat.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-03-26 20:04:40 +0200
committerAndrei Karas <akaras@inbox.ru>2011-03-26 20:04:40 +0200
commitadfacb195ba653b63fec08200d0535604d45e20e (patch)
tree0222d33fd3e26b9e87cda7fa00119ac44acc94d4 /src/gui/chat.cpp
parentd1be68b99867261dc9298f3441acc09028897d6f (diff)
downloadplus-adfacb195ba653b63fec08200d0535604d45e20e.tar.gz
plus-adfacb195ba653b63fec08200d0535604d45e20e.tar.bz2
plus-adfacb195ba653b63fec08200d0535604d45e20e.tar.xz
plus-adfacb195ba653b63fec08200d0535604d45e20e.zip
Add option to chat context menu to remove nicks.
Usefull for example for tmw guild bot.
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r--src/gui/chat.cpp23
1 files changed, 22 insertions, 1 deletions
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);
}
}