summaryrefslogtreecommitdiff
path: root/src/xmpp/adhoc_session.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-05-30 04:03:36 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-05-30 04:03:36 +0200
commit86c6f36faebadfc028ea5f9c64e5769fb0f77170 (patch)
treeccfaf85d76c77221aa46b894e120920203ae56d6 /src/xmpp/adhoc_session.cpp
parentd33a3b7d3587c22d54761e3ed04c85452d7ec550 (diff)
downloadbiboumi-86c6f36faebadfc028ea5f9c64e5769fb0f77170.tar.gz
biboumi-86c6f36faebadfc028ea5f9c64e5769fb0f77170.tar.bz2
biboumi-86c6f36faebadfc028ea5f9c64e5769fb0f77170.tar.xz
biboumi-86c6f36faebadfc028ea5f9c64e5769fb0f77170.zip
Add missing files (for adhoc command support)
Diffstat (limited to 'src/xmpp/adhoc_session.cpp')
-rw-r--r--src/xmpp/adhoc_session.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/xmpp/adhoc_session.cpp b/src/xmpp/adhoc_session.cpp
new file mode 100644
index 0000000..fc60bb7
--- /dev/null
+++ b/src/xmpp/adhoc_session.cpp
@@ -0,0 +1,37 @@
+#include <xmpp/adhoc_session.hpp>
+#include <xmpp/adhoc_command.hpp>
+
+#include <assert.h>
+
+AdhocSession::AdhocSession(const AdhocCommand& command, const std::string& jid):
+ command(command),
+ owner_jid(jid),
+ current_step(0),
+ terminated(false)
+{
+}
+
+AdhocSession::~AdhocSession()
+{
+}
+
+const AdhocStep& AdhocSession::get_next_step()
+{
+ assert(this->current_step < this->command.callbacks.size());
+ return this->command.callbacks[this->current_step++];
+}
+
+size_t AdhocSession::remaining_steps() const
+{
+ return this->command.callbacks.size() - this->current_step;
+}
+
+bool AdhocSession::is_terminated() const
+{
+ return this->terminated;
+}
+
+void AdhocSession::terminate()
+{
+ this->terminated = true;
+}