This commit is contained in:
2024-06-10 15:31:55 +02:00
parent a604e93070
commit 826de5d786
12 changed files with 131 additions and 60 deletions

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/21 18:09:05 by fgras-ca #+# #+# */
/* Updated: 2024/06/06 18:41:04 by fgras-ca ### ########.fr */
/* Updated: 2024/06/10 13:28:55 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/06/06 11:44:44 by fgras-ca #+# #+# */
/* Updated: 2024/06/06 18:50:12 by fgras-ca ### ########.fr */
/* Updated: 2024/06/10 14:46:42 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -35,6 +35,7 @@ public:
void loadBadWords(const std::string& fileName);
bool checkMessage(Client* client, Channel* channel, const std::string& message);
void warnClient(Client* client, Channel* channel);
void warnClientDirect(Client* client);
void kickClient(Client* client, Channel* channel);
private:

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/30 11:12:57 by fgras-ca #+# #+# */
/* Updated: 2024/06/07 12:24:49 by fgras-ca ### ########.fr */
/* Updated: 2024/06/08 18:53:15 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -45,7 +45,7 @@ class ModeHandler
void applyModeL(Client *client, Channel* channel, bool adding, const std::string& argument);
void applyModeI(Client *client, Channel* channel, bool adding);
void applyModeK(Client *client, Channel* channel, bool adding, const std::string& argument);
void applyModeT(Channel* channel, bool adding);
void applyModeT(Client *client, Channel* channel, bool adding);
void applyModeO(Client *client, Channel* channel, bool adding, const std::string& argument);
bool needsArgument(char mode);
};

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/19 15:12:47 by fgras-ca #+# #+# */
/* Updated: 2024/06/07 14:00:45 by fgras-ca ### ########.fr */
/* Updated: 2024/06/08 20:20:39 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -391,10 +391,10 @@ inline std::string ERR_NOTREGISTERED(Client* client)
//RPL Password
// RPL Error Messages
inline std::string ERR_NEEDMOREPARAMS(Client* client, const std::string& command)
inline std::string ERR_NEEDMOREPARAMS(Client* client, std::string channel, const std::string& command)
{
std::ostringstream oss;
oss << ":" << SERVER_NAME << " 461 " << CLIENT_NICK(client) << " " << command << " :Not enough parameters\r\n";
oss << ":" << SERVER_NAME << " 461 " << CLIENT_NICK(client) << " " << channel << command << " :Not enough parameters\r\n";
return oss.str();
}
@@ -541,10 +541,10 @@ inline std::string RPL_CAPEND(Client *client)
return oss.str();
}
inline std::string MODEACCEPTMESSAGE(Client *client, std::string channel, const std::string& mode)
inline std::string MODEACCEPTMESSAGE(Client *client, std::string channel, const std::string& mode, const std::string& argument)
{
std::ostringstream oss;
oss << ":" << client->getNickname() << " MODE " << channel << " " << mode << " :" << "\r\n";
oss << ":" << client->getNickname() << " MODE " << channel << " " << mode << argument << "\r\n";
return oss.str();
}
@@ -555,10 +555,10 @@ inline std::string BOTMESSAGE(Client *client, const std::string &channel, const
return oss.str();
}
inline std::string MODELCHANGE(Client *client, std::string channel, const std::string& mode)
inline std::string MODELNEEDPARAM(const std::string& mode)
{
std::ostringstream oss;
oss << SERVER_NAME <<":" << client->getNickname() << " MODE " << channel << " " << mode << " :" << "\r\n";
oss << mode << ":NOT enought parameters" << "\r\n";
return oss.str();
}