From 0ab40dc1ab4e689921da54080b135e1d22b1c586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 14 Mar 2017 21:45:23 +0100 Subject: Refactoring louloulibs and cmake Use OBJECT libraries Remove the louloulibs directory Write FOUND variables in the cache --- src/xmpp/adhoc_session.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/xmpp/adhoc_session.cpp (limited to 'src/xmpp/adhoc_session.cpp') diff --git a/src/xmpp/adhoc_session.cpp b/src/xmpp/adhoc_session.cpp new file mode 100644 index 0000000..dda4bea --- /dev/null +++ b/src/xmpp/adhoc_session.cpp @@ -0,0 +1,35 @@ +#include +#include + +#include + +AdhocSession::AdhocSession(const AdhocCommand& command, const std::string& owner_jid, + const std::string& to_jid): + command(command), + owner_jid(owner_jid), + to_jid(to_jid), + current_step(0), + terminated(false) +{ +} + +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; +} -- cgit v1.2.3