Store the target jid in the AdhocSession objects

This commit is contained in:
Florent Le Coz
2015-09-18 22:09:26 +02:00
parent 88ae2599f6
commit 19666d2ffd
4 changed files with 22 additions and 6 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ std::map<const std::string, const AdhocCommand>& AdhocCommandsHandler::get_comma
return this->commands;
}
XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, XmlNode command_node)
XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, const std::string& to, XmlNode command_node)
{
std::string action = command_node.get_tag("action");
if (action.empty())
@@ -57,7 +57,7 @@ XmlNode AdhocCommandsHandler::handle_request(const std::string& executor_jid, Xm
command_node["sessionid"] = sessionid;
this->sessions.emplace(std::piecewise_construct,
std::forward_as_tuple(sessionid, executor_jid),
std::forward_as_tuple(command_it->second, executor_jid));
std::forward_as_tuple(command_it->second, executor_jid, to));
TimedEventsManager::instance().add_event(TimedEvent(std::chrono::steady_clock::now() + 3600s,
std::bind(&AdhocCommandsHandler::remove_session, this, sessionid, executor_jid),
"adhocsession"s + sessionid + executor_jid));