26 bool isNotice = (command ==
"NOTICE");
37 if (args.
size() < 2) {
48 if (target[0] ==
'#') {
51 if (channel == NULL) {
73 std::string fullMessage = sender->
getPrefix() +
" " + command +
" " + target +
" :" + message +
"\r\n";
78 if (recipient == NULL) {
88 std::string fullMessage = sender->
getPrefix() +
" " + command +
" " + target +
" :" + message +
"\r\n";
Manages channel members and states.
Manages client connection and state.
std::vector< std::string > split(const std::string &s, char delimiter)
Splits a string into a vector of strings based on a delimiter.
void handleMessage(Server *server, Client *sender, const std::string &command, const std::vector< std::string > &args)
Handles sending messages to a target (user or channel) for PRIVMSG and NOTICE commands.
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.
#define ERR_CANNOTSENDTOCHAN
#define ERR_NOSUCHCHANNEL
Core IRC server implementation.
bool hasMode(char mode) const
bool isMember(Client *client) const
void broadcast(const std::string &message, Client *excludeClient)
Represents an IRC client connected to the server.
std::string getPrefix() const
Generates the client's IRC prefix (e.g., :nick!user@host).
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.
Implements the core IRC server functionality as a Singleton.
Channel * getChannel(const std::string &name)
Retrieves a Channel object by its name.
Client * getClientByNickname(const std::string &nickname)
Retrieves a Client object by its nickname.
const std::string & getServerName() const
Gets the server's name.