#pragma once #include "thread.hpp" #include "connection.hpp" #include "irc_parse_thread.hpp" #include "write_irc.hpp" #include #include #include struct RegistrationThread : Thread { Connection * connection_; std::string password_; std::string username_; std::string realname_; std::string nickname_; std::unordered_map caps; std::unordered_set outstanding; enum class Stage { LsReply, AckReply, }; Stage stage_; RegistrationThread( Connection * connection_, std::string password, std::string username, std::string realname, std::string nickname ); auto priority() const -> priority_type override; auto on_connect() -> Thread::callback_result; auto send_req() -> Thread::callback_result; auto capack(IrcMsg const& msg) -> Thread::callback_result; auto capls(IrcMsg const& msg) -> Thread::callback_result; auto on_msg(IrcMsg const& msg) -> Thread::callback_result; auto on_event(Event const& event) -> Thread::callback_result override; };