xbot/registration.hpp
2025-01-26 19:43:17 -08:00

44 lines
997 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>
{
Connection &connection_;
const Settings &settings_;
std::shared_ptr<Client> self_;
std::unordered_map<std::string, std::string> caps;
std::unordered_set<std::string> outstanding;
boost::signals2::scoped_connection slot_;
auto on_connect() -> void;
auto send_req() -> void;
auto on_msg_cap_ls(const IrcMsg &msg) -> void;
auto on_msg_cap_ack(const IrcMsg &msg) -> void;
auto listen_for_cap_ack() -> void;
auto listen_for_cap_ls() -> void;
public:
Registration(
Connection &,
const Settings &,
std::shared_ptr<Client>
);
static auto start(
Connection &,
const Settings &,
std::shared_ptr<Client>
) -> std::shared_ptr<Registration>;
};