diff --git a/ft_irc3/includes/RPL.hpp b/ft_irc3/includes/RPL.hpp index d2bd04d..97d4a95 100644 --- a/ft_irc3/includes/RPL.hpp +++ b/ft_irc3/includes/RPL.hpp @@ -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(); } diff --git a/ft_irc3/ircserv b/ft_irc3/ircserv deleted file mode 100644 index 6ecaaa0..0000000 Binary files a/ft_irc3/ircserv and /dev/null differ diff --git a/ft_irc3/obj/AdditionalCommands.o b/ft_irc3/obj/AdditionalCommands.o deleted file mode 100644 index e5a4310..0000000 Binary files a/ft_irc3/obj/AdditionalCommands.o and /dev/null differ diff --git a/ft_irc3/obj/Channel.o b/ft_irc3/obj/Channel.o deleted file mode 100644 index 83a3f88..0000000 Binary files a/ft_irc3/obj/Channel.o and /dev/null differ diff --git a/ft_irc3/obj/Client.o b/ft_irc3/obj/Client.o deleted file mode 100644 index a5ee1a3..0000000 Binary files a/ft_irc3/obj/Client.o and /dev/null differ diff --git a/ft_irc3/obj/ClientManager.o b/ft_irc3/obj/ClientManager.o deleted file mode 100644 index 654e37d..0000000 Binary files a/ft_irc3/obj/ClientManager.o and /dev/null differ diff --git a/ft_irc3/obj/CommandHandler.o b/ft_irc3/obj/CommandHandler.o deleted file mode 100644 index 5c41ecd..0000000 Binary files a/ft_irc3/obj/CommandHandler.o and /dev/null differ diff --git a/ft_irc3/obj/InviteHandler.o b/ft_irc3/obj/InviteHandler.o deleted file mode 100644 index 221f7c9..0000000 Binary files a/ft_irc3/obj/InviteHandler.o and /dev/null differ diff --git a/ft_irc3/obj/Join.o b/ft_irc3/obj/Join.o deleted file mode 100644 index d38b698..0000000 Binary files a/ft_irc3/obj/Join.o and /dev/null differ diff --git a/ft_irc3/obj/KickHandler.o b/ft_irc3/obj/KickHandler.o deleted file mode 100644 index 24e6329..0000000 Binary files a/ft_irc3/obj/KickHandler.o and /dev/null differ diff --git a/ft_irc3/obj/ModeHandler.o b/ft_irc3/obj/ModeHandler.o deleted file mode 100644 index 7e5766b..0000000 Binary files a/ft_irc3/obj/ModeHandler.o and /dev/null differ diff --git a/ft_irc3/obj/Server.o b/ft_irc3/obj/Server.o deleted file mode 100644 index bde9d6d..0000000 Binary files a/ft_irc3/obj/Server.o and /dev/null differ diff --git a/ft_irc3/obj/TopicHandler.o b/ft_irc3/obj/TopicHandler.o deleted file mode 100644 index 8c3eb37..0000000 Binary files a/ft_irc3/obj/TopicHandler.o and /dev/null differ diff --git a/ft_irc3/obj/Utils.o b/ft_irc3/obj/Utils.o deleted file mode 100644 index 31bf36e..0000000 Binary files a/ft_irc3/obj/Utils.o and /dev/null differ diff --git a/ft_irc3/obj/Welcome.o b/ft_irc3/obj/Welcome.o deleted file mode 100644 index 5660ab1..0000000 Binary files a/ft_irc3/obj/Welcome.o and /dev/null differ diff --git a/ft_irc3/obj/Who.o b/ft_irc3/obj/Who.o deleted file mode 100644 index 97ebb4f..0000000 Binary files a/ft_irc3/obj/Who.o and /dev/null differ diff --git a/ft_irc3/obj/main.o b/ft_irc3/obj/main.o deleted file mode 100644 index 9e26c52..0000000 Binary files a/ft_irc3/obj/main.o and /dev/null differ diff --git a/ft_irc3/src/AdditionalCommands.cpp b/ft_irc3/src/AdditionalCommands.cpp index 6c9740c..7407b12 100644 --- a/ft_irc3/src/AdditionalCommands.cpp +++ b/ft_irc3/src/AdditionalCommands.cpp @@ -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; diff --git a/ft_irc3/src/CommandHandler.cpp b/ft_irc3/src/CommandHandler.cpp index ad1a3a4..96dc54f 100644 --- a/ft_irc3/src/CommandHandler.cpp +++ b/ft_irc3/src/CommandHandler.cpp @@ -268,9 +268,8 @@ void CommandHandler::handlePingCommand(Client* client, const std::vectorsendToClient(client->getFd(), pongMessage); + std::string latence = tokens[1]; + _server->sendToClient(client->getFd(), RPL_PONG(latence)); } diff --git a/ft_irc3/src/InviteHandler.cpp b/ft_irc3/src/InviteHandler.cpp index 2b66b05..dd50414 100644 --- a/ft_irc3/src/InviteHandler.cpp +++ b/ft_irc3/src/InviteHandler.cpp @@ -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";