summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/commands.cpp14
-rw-r--r--src/actions/commands.h1
2 files changed, 15 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
diff --git a/src/actions/commands.h b/src/actions/commands.h
index f5f4b4a5e..fbee9e125 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -47,6 +47,7 @@ namespace Actions
decHandler(pseudoAway);
decHandler(follow);
decHandler(navigate);
+ decHandler(imitation);
} // namespace Actions
#undef decHandler