26 Client *targetClient = it->second;
33 bool matches_query =
false;
37 }
else if (query[0] ==
'#') {
40 if (channel && channel->
isMember(targetClient)) {
58 for (
size_t i = 0; i < client_channels.
size(); ++i) {
59 Channel *ch = client_channels[i];
60 if (query.
empty() || query[0] ==
'#') {
78 status_flags += op_flag;
Manages channel members and states.
Manages client connection and state.
Utility functions for command handling.
std::string formatReply(const std::string &serverName, const std::string &clientNickname, const std::string &replyCodeAndText)
Formats an IRC reply message without extra parameters.
Defines IRC numeric replies and error messages.
Core IRC server implementation.
const std::string & getName() const
bool isMember(Client *client) const
bool isOperator(Client *client) const
Represents an IRC client connected to the server.
bool isRegistered() const
Checks if the client is registered.
const std::vector< Channel * > & getChannels() const
Gets the list of channels the client is in.
virtual void sendMessage(const std::string &message) const
Sends a message to the client by appending it to the send buffer.
const std::string & getNickname() const
Gets the client's nickname.
const std::string & getHostname() const
Gets the client's hostname.
Abstract base class (interface) for all IRC commands.
Server * _server
Pointer to the IRC server instance.
Implements the core IRC server functionality as a Singleton.
Channel * getChannel(const std::string &name)
Retrieves a Channel object by its name.
const std::map< int, Client * > & getClients() const
Gets a constant reference to the map of clients managed by the server.
const std::string & getServerName() const
Gets the server's name.
void execute(Client *client, const std::vector< std::string > &args)
Executes the WHO command.
WhoCommand(Server *server)
Constructs a WhoCommand object.