summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/AdHoc/OutgoingAdHocCommandSession.cpp8
-rw-r--r--Swiften/AdHoc/OutgoingAdHocCommandSession.h5
2 files changed, 7 insertions, 6 deletions
diff --git a/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp b/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp
index 0632bbf..ecc6cd0 100644
--- a/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp
+++ b/Swiften/AdHoc/OutgoingAdHocCommandSession.cpp
@@ -13,7 +13,7 @@
#include <Swiften/Base/Algorithm.h>
namespace Swift {
-OutgoingAdHocCommandSession::OutgoingAdHocCommandSession(const DiscoItems::Item& command, IQRouter* iqRouter) : command_(command), iqRouter_(iqRouter), isMultiStage_(false) {
+OutgoingAdHocCommandSession::OutgoingAdHocCommandSession(const JID& to, const std::string& commandNode, IQRouter* iqRouter) : to_(to), commandNode_(commandNode), iqRouter_(iqRouter), isMultiStage_(false) {
}
@@ -57,7 +57,7 @@ bool OutgoingAdHocCommandSession::getIsMultiStage() const {
}
void OutgoingAdHocCommandSession::start() {
- boost::shared_ptr<GenericRequest<Command> > commandRequest = boost::make_shared< GenericRequest<Command> >(IQ::Set, command_.getJID(), boost::make_shared<Command>(command_.getNode()), iqRouter_);
+ boost::shared_ptr<GenericRequest<Command> > commandRequest = boost::make_shared< GenericRequest<Command> >(IQ::Set, to_, boost::make_shared<Command>(commandNode_), iqRouter_);
commandRequest->onResponse.connect(boost::bind(&OutgoingAdHocCommandSession::handleResponse, this, _1, _2));
commandRequest->send();
}
@@ -81,9 +81,9 @@ void OutgoingAdHocCommandSession::goNext(Form::ref form) {
}
void OutgoingAdHocCommandSession::submitForm(Form::ref form, Command::Action action) {
- boost::shared_ptr<Command> command(boost::make_shared<Command>(command_.getNode(), sessionID_, action));
+ boost::shared_ptr<Command> command(boost::make_shared<Command>(commandNode_, sessionID_, action));
command->setForm(form);
- boost::shared_ptr<GenericRequest<Command> > commandRequest = boost::make_shared< GenericRequest<Command> >(IQ::Set, command_.getJID(), command, iqRouter_);
+ boost::shared_ptr<GenericRequest<Command> > commandRequest = boost::make_shared< GenericRequest<Command> >(IQ::Set, to_, command, iqRouter_);
commandRequest->onResponse.connect(boost::bind(&OutgoingAdHocCommandSession::handleResponse, this, _1, _2));
commandRequest->send();
}
diff --git a/Swiften/AdHoc/OutgoingAdHocCommandSession.h b/Swiften/AdHoc/OutgoingAdHocCommandSession.h
index 6b80300..5c27022 100644
--- a/Swiften/AdHoc/OutgoingAdHocCommandSession.h
+++ b/Swiften/AdHoc/OutgoingAdHocCommandSession.h
@@ -29,7 +29,7 @@ namespace Swift {
Enabled /** Action is applicable and currently available */ = 2,
EnabledAndPresent = 3};
- OutgoingAdHocCommandSession(const DiscoItems::Item& command, IQRouter* iqRouter);
+ OutgoingAdHocCommandSession(const JID& to, const std::string& commandNode, IQRouter* iqRouter);
/**
* Send initial request to the target.
*/
@@ -82,7 +82,8 @@ namespace Swift {
void submitForm(Form::ref, Command::Action action);
private:
- DiscoItems::Item command_;
+ JID to_;
+ std::string commandNode_;
IQRouter* iqRouter_;
bool isMultiStage_;
std::string sessionID_;