mirror of
https://github.com/Ladebeze66/ft_irc.git
synced 2025-12-16 22:18:04 +01:00
petit fix
This commit is contained in:
parent
ad3f0bae39
commit
489263b521
@ -183,10 +183,10 @@ inline std::string RPL_ENDOFINVITELIST(Client *client, const std::string& channe
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
inline std::string RPL_INVITING(Client* client, const std::string& channel)
|
||||
inline std::string RPL_INVITING(Client* client, Client* clientTarget, const std::string& channel)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << ":" << SERVER_NAME << " 341 " << CLIENT_NICK(client) << " " << CLIENT_NICK(client) << " " << channel << "\r\n";
|
||||
oss << ":" << SERVER_NAME << " 341 " << CLIENT_NICK(client) << " " << CLIENT_NICK(clientTarget) << " " << channel << "\r\n";
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ inline std::string RPL_WHOREPLY(const std::string& channel, Client* target)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << ":" << SERVER_NAME << " 352 " << CLIENT_NICK(target) << " " << channel << " "
|
||||
<< CLIENT_USER(target) << " " << CLIENT_HOST(target) << " " << SERVER_NAME << " "
|
||||
<< CLIENT_USER(target) << " " << CLIENT_HOST(target) << SERVER_NAME << " "
|
||||
<< CLIENT_NICK(target) << " H :0 " << CLIENT_REALNAME(target) << "\r\n";
|
||||
return oss.str();
|
||||
}
|
||||
@ -508,7 +508,7 @@ inline std::string ERR_INVALIDMODEPARAM(Client* client, const std::string& param
|
||||
inline std::string RPL_PONG(const std::string& token)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << ":" << SERVER_NAME << " PONG " << SERVER_NAME << " " << token << "\r\n";
|
||||
oss << ":" << SERVER_NAME << " PONG " << SERVER_NAME << " :" << token << "\r\n";
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
|
||||
BIN
ft_irc3/ircserv
BIN
ft_irc3/ircserv
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -107,6 +107,8 @@ void AdditionalCommands::handlePartCommand(Server *server, Client *client, const
|
||||
partMsg << ":" << client->getNickname() << " PART " << channelName << "\r\n";
|
||||
server->sendToClient(client->getFd(), partMsg.str());
|
||||
|
||||
channel->broadcast(partMsg.str(), client, server);
|
||||
|
||||
if (channel->isEmpty())
|
||||
{
|
||||
delete channel;
|
||||
|
||||
@ -268,9 +268,8 @@ void CommandHandler::handlePingCommand(Client* client, const std::vector<std::st
|
||||
return;
|
||||
}
|
||||
|
||||
std::string serverName = tokens[1];
|
||||
std::string pongMessage = ":" + serverName + " PONG " + serverName + "\r\n";
|
||||
_server->sendToClient(client->getFd(), pongMessage);
|
||||
std::string latence = tokens[1];
|
||||
_server->sendToClient(client->getFd(), RPL_PONG(latence));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ void InviteHandler::handleInviteCommand(Client* client, const std::string& comma
|
||||
return;
|
||||
}
|
||||
|
||||
if (!channel->isOperator(client) && channel->isInviteOnly())
|
||||
if (!channel->isOperator(client))
|
||||
{
|
||||
_server->sendToClient(client->getFd(), ERR_CHANOPRIVSNEEDED(client, channelName));
|
||||
return;
|
||||
@ -59,7 +59,7 @@ void InviteHandler::handleInviteCommand(Client* client, const std::string& comma
|
||||
}
|
||||
|
||||
channel->addInvitedClient(targetClient);
|
||||
_server->sendToClient(client->getFd(), RPL_INVITING(client, channel->getName()));
|
||||
_server->sendToClient(client->getFd(), RPL_INVITING(client, targetClient, channel->getName()));
|
||||
|
||||
std::ostringstream inviteMsg;
|
||||
inviteMsg << ":" << client->getNickname() << " INVITE " << nickname << " " << channelName << "\r\n";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user