17 if (args.
size() < 2) {
28 if (targetClient == NULL) {
36 if (channel == NULL) {
57 if (channel->
isMember(targetClient)) {
69 std::string inviteMessage = client->
getPrefix() +
" INVITE " + targetNick +
" :" + channelName +
"\r\n";
Manages channel members and states.
Manages client connection and state.
Handles the INVITE command.
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_USERONCHANNEL
#define ERR_CHANOPRIVSNEEDED
#define ERR_NOSUCHCHANNEL
#define ERR_NEEDMOREPARAMS
Core IRC server implementation.
bool hasMode(char mode) const
bool isMember(Client *client) const
void addInvitedUser(Client *client)
bool isOperator(Client *client) const
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.
Abstract base class (interface) for all IRC commands.
Server * _server
Pointer to the IRC server instance.
void execute(Client *client, const std::vector< std::string > &args)
Executes the INVITE command.
InviteCommand(Server *server)
Constructs an InviteCommand object.
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.