31 lines
771 B
C++
31 lines
771 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <unordered_set>
|
|
|
|
struct Connection;
|
|
|
|
/**
|
|
* @brief Thread to track this connection's identity, and IRC state.
|
|
*
|
|
*/
|
|
class SelfThread
|
|
{
|
|
Connection& connection_;
|
|
std::string nickname_;
|
|
std::string mode_;
|
|
std::unordered_set<std::string> channels_;
|
|
|
|
public:
|
|
SelfThread(Connection& connection) : connection_{connection} {}
|
|
static auto start(Connection&) -> std::shared_ptr<SelfThread>;
|
|
|
|
auto get_my_nickname() const -> std::string const&;
|
|
auto get_my_mode() const -> std::string const&;
|
|
auto get_my_channels() const -> std::unordered_set<std::string> const&;
|
|
|
|
auto is_my_nick(std::string_view nick) const -> bool;
|
|
auto is_my_mask(std::string_view nick) const -> bool;
|
|
};
|