summaryrefslogtreecommitdiff
path: root/louloulibs
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2016-09-29 23:10:41 +0200
committerlouiz’ <louiz@louiz.org>2016-09-29 23:10:41 +0200
commit265b5df61b5f3d4b5f30bbc6518f833f73bda1ff (patch)
treed31bbd3de2b4d2d955d26c026863568d2b21f48f /louloulibs
parentee4cf5dc2d3eaa43794a8ac736a6409e08082882 (diff)
downloadbiboumi-265b5df61b5f3d4b5f30bbc6518f833f73bda1ff.tar.gz
biboumi-265b5df61b5f3d4b5f30bbc6518f833f73bda1ff.tar.bz2
biboumi-265b5df61b5f3d4b5f30bbc6518f833f73bda1ff.tar.xz
biboumi-265b5df61b5f3d4b5f30bbc6518f833f73bda1ff.zip
Re-add the ad-hoc command the was removed by mistake in the previous commit
Thank you, e2e tests
Diffstat (limited to 'louloulibs')
-rw-r--r--louloulibs/xmpp/adhoc_commands_handler.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/louloulibs/xmpp/adhoc_commands_handler.cpp b/louloulibs/xmpp/adhoc_commands_handler.cpp
index 573c9ec..540cac0 100644
--- a/louloulibs/xmpp/adhoc_commands_handler.cpp
+++ b/louloulibs/xmpp/adhoc_commands_handler.cpp
@@ -17,6 +17,9 @@ const std::map<const std::string, const AdhocCommand>& AdhocCommandsHandler::get
void AdhocCommandsHandler::add_command(std::string name, AdhocCommand command)
{
+ const auto found = this->commands.find(name);
+ if (found != this->commands.end())
+ throw std::runtime_error("Trying to add an ad-hoc command that already exist: "s + name);
this->commands.emplace(std::make_pair(std::move(name), std::move(command)));
}