39 lines
871 B
C++
39 lines
871 B
C++
#pragma once
|
|
|
|
#include "connection.hpp"
|
|
#include "client.hpp"
|
|
#include "settings.hpp"
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <unordered_set>
|
|
|
|
class Registration : public std::enable_shared_from_this<Registration>
|
|
{
|
|
const Settings &settings_;
|
|
std::shared_ptr<Client> client_;
|
|
|
|
boost::signals2::scoped_connection slot_;
|
|
boost::signals2::scoped_connection caps_slot_;
|
|
|
|
auto on_connect() -> void;
|
|
auto on_cap_list(const std::unordered_map<std::string, std::string> &) -> void;
|
|
|
|
auto on_ircmsg(IrcCommand, const IrcMsg &msg) -> void;
|
|
|
|
auto send_req() -> void;
|
|
auto randomize_nick() -> void;
|
|
|
|
public:
|
|
Registration(
|
|
const Settings &,
|
|
std::shared_ptr<Client>
|
|
);
|
|
|
|
static auto start(
|
|
const Settings &,
|
|
std::shared_ptr<Client>
|
|
) -> std::shared_ptr<Registration>;
|
|
};
|