#pragma once #include #include "connection.hpp" #include "irc_parse_thread.hpp" #include #include #include #include class RegistrationThread : public std::enable_shared_from_this { Connection& connection_; std::string password_; std::string username_; std::string realname_; std::string nickname_; std::unordered_map caps; std::unordered_set outstanding; Connection::Handle connect_handle_; Connection::Handle message_handle_; auto on_connect() -> void; auto send_req() -> void; auto on_msg_cap_ls(IrcMsg const& msg) -> void; auto on_msg_cap_ack(IrcMsg const& msg) -> void; auto listen_for_cap_ack() -> void; auto listen_for_cap_ls() -> void; public: RegistrationThread( Connection& connection_, std::string password, std::string username, std::string realname, std::string nickname ); static auto start( Connection& connection, std::string password, std::string username, std::string realname, std::string nickname ) -> std::shared_ptr; };