mirror of
https://github.com/Ladebeze66/ft_irc.git
synced 2025-12-17 06:28:03 +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();
|
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;
|
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();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ inline std::string RPL_WHOREPLY(const std::string& channel, Client* target)
|
|||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << ":" << SERVER_NAME << " 352 " << CLIENT_NICK(target) << " " << channel << " "
|
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";
|
<< CLIENT_NICK(target) << " H :0 " << CLIENT_REALNAME(target) << "\r\n";
|
||||||
return oss.str();
|
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)
|
inline std::string RPL_PONG(const std::string& token)
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << ":" << SERVER_NAME << " PONG " << SERVER_NAME << " " << token << "\r\n";
|
oss << ":" << SERVER_NAME << " PONG " << SERVER_NAME << " :" << token << "\r\n";
|
||||||
return oss.str();
|
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";
|
partMsg << ":" << client->getNickname() << " PART " << channelName << "\r\n";
|
||||||
server->sendToClient(client->getFd(), partMsg.str());
|
server->sendToClient(client->getFd(), partMsg.str());
|
||||||
|
|
||||||
|
channel->broadcast(partMsg.str(), client, server);
|
||||||
|
|
||||||
if (channel->isEmpty())
|
if (channel->isEmpty())
|
||||||
{
|
{
|
||||||
delete channel;
|
delete channel;
|
||||||
|
|||||||
@ -268,9 +268,8 @@ void CommandHandler::handlePingCommand(Client* client, const std::vector<std::st
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string serverName = tokens[1];
|
std::string latence = tokens[1];
|
||||||
std::string pongMessage = ":" + serverName + " PONG " + serverName + "\r\n";
|
_server->sendToClient(client->getFd(), RPL_PONG(latence));
|
||||||
_server->sendToClient(client->getFd(), pongMessage);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ void InviteHandler::handleInviteCommand(Client* client, const std::string& comma
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!channel->isOperator(client) && channel->isInviteOnly())
|
if (!channel->isOperator(client))
|
||||||
{
|
{
|
||||||
_server->sendToClient(client->getFd(), ERR_CHANOPRIVSNEEDED(client, channelName));
|
_server->sendToClient(client->getFd(), ERR_CHANOPRIVSNEEDED(client, channelName));
|
||||||
return;
|
return;
|
||||||
@ -59,7 +59,7 @@ void InviteHandler::handleInviteCommand(Client* client, const std::string& comma
|
|||||||
}
|
}
|
||||||
|
|
||||||
channel->addInvitedClient(targetClient);
|
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;
|
std::ostringstream inviteMsg;
|
||||||
inviteMsg << ":" << client->getNickname() << " INVITE " << nickname << " " << channelName << "\r\n";
|
inviteMsg << ":" << client->getNickname() << " INVITE " << nickname << " " << channelName << "\r\n";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user