diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-26 12:04:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-26 12:04:45 +0300 |
commit | 1a9a7ece01b6633e1fe860cba03bfd0d895c172d (patch) | |
tree | da2b92377903081be4746a2eb8ce5a879c334691 /src/actions/commands.cpp | |
parent | ae4062ed3c48706127c32efbc70cca0cc5ce19f8 (diff) | |
download | plus-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.tar.gz plus-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.tar.bz2 plus-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.tar.xz plus-1a9a7ece01b6633e1fe860cba03bfd0d895c172d.zip |
Move chat command /imitation into actions.
Diffstat (limited to 'src/actions/commands.cpp')
-rw-r--r-- | src/actions/commands.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 29e7e740c..29414b18d 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -409,4 +409,18 @@ impHandler(navigate) return true; } +impHandler(imitation) +{ + if (!localPlayer) + return false; + + if (!event.args.empty()) + localPlayer->setImitate(event.args); + else if (event.tab && event.tab->getType() == ChatTabType::WHISPER) + localPlayer->setImitate(static_cast<WhisperTab*>(event.tab)->getNick()); + else + localPlayer->setImitate(""); + return true; +} + } // namespace Actions |