~singpolyma/biboumi

ref: 7b3e0e0cf3eddd3537455a3605b04a48ee663f47 biboumi/src/xmpp/adhoc_session.cpp -rw-r--r-- 754 bytes
7b3e0e0c — louiz’ Make botan’s policy configurable from a file 5 years ago
                                                                                
e1a7114c Florent Le Coz
1a09c965 louiz’
e1a7114c Florent Le Coz
19666d2f Florent Le Coz
e1a7114c Florent Le Coz
19666d2f Florent Le Coz
e1a7114c Florent Le Coz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <xmpp/adhoc_session.hpp>
#include <xmpp/adhoc_command.hpp>

#include <cassert>

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;
}