~singpolyma/biboumi

265b5df61b5f3d4b5f30bbc6518f833f73bda1ff — louiz’ 7 years ago ee4cf5d
Re-add the ad-hoc command the was removed by mistake in the previous commit

Thank you, e2e tests
2 files changed, 4 insertions(+), 1 deletions(-)

M louloulibs/xmpp/adhoc_commands_handler.cpp
M src/xmpp/biboumi_component.cpp
M louloulibs/xmpp/adhoc_commands_handler.cpp => louloulibs/xmpp/adhoc_commands_handler.cpp +3 -0
@@ 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)));
}


M src/xmpp/biboumi_component.cpp => src/xmpp/biboumi_component.cpp +1 -1
@@ 59,7 59,7 @@ BiboumiComponent::BiboumiComponent(std::shared_ptr<Poller> poller, const std::st
  this->adhoc_commands_handler.add_command("ping", {{&PingStep1}, "Do a ping", false});
  this->adhoc_commands_handler.add_command("hello", {{&HelloStep1, &HelloStep2}, "Receive a custom greeting", false});
  this->adhoc_commands_handler.add_command("disconnect-user", {{&DisconnectUserStep1, &DisconnectUserStep2}, "Disconnect selected users from the gateway", true});
  this->adhoc_commands_handler.add_command("hello", {{&HelloStep1, &HelloStep2}, "Receive a custom greeting", false});
  this->adhoc_commands_handler.add_command("disconnect-from-irc-server", {{&DisconnectUserFromServerStep1, &DisconnectUserFromServerStep2, &DisconnectUserFromServerStep3}, "Disconnect from the selected IRC servers", false});
  this->adhoc_commands_handler.add_command("reload", {{&Reload}, "Reload biboumi’s configuration", true});

#ifdef USE_DATABASE