This commit is contained in:
Ladebeze66
2024-05-31 12:34:41 +02:00
parent 4f8d1f3d1f
commit 49537a7282
6 changed files with 83 additions and 122 deletions

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/15 12:15:42 by fgras-ca #+# #+# */
/* Updated: 2024/05/28 14:17:16 by fgras-ca ### ########.fr */
/* Updated: 2024/05/31 11:31:54 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -41,6 +41,8 @@ public:
const std::string &getAwayMessage() const;
void setAwayMessage(const std::string &message);
void setAway(bool away);
const std::string &getkey() const;
void setkey(const std::string &key);
private:
int _fd;
@@ -53,6 +55,7 @@ private:
bool _operator;
bool _away;
std::string _awayMessage;
std::string _key;
};
#endif // CLIENT_HPP

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/05/30 18:40:48 by fgras-ca ### ########.fr */
/* Updated: 2024/05/31 11:21:04 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -45,7 +45,7 @@ private:
//void applyModeB(Channel* channel, bool adding, const std::string& argument);
void applyModeL(Channel* channel, bool adding, const std::string& argument);
void applyModeI(Channel* channel, bool adding);
void applyModeK(Channel* channel, bool adding, const std::string& argument);
void applyModeK(Client *client, Channel* channel, bool adding, const std::string& argument);
void applyModeT(Channel* channel, bool adding);
void applyModeO(Client *client, Channel* channel, bool adding, const std::string& argument);
};

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/05/30 17:49:15 by fgras-ca ### ########.fr */
/* Updated: 2024/05/31 11:18:49 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -20,9 +20,9 @@
#define SERVER_NAME "IRC_Server"
#define SERVER_VERSION "1.0"
#define USER_MODES "+o/-o"
#define CHANNEL_MODES "none"
#define CHANNEL_MODES_WITH_PARAMS "None"
#define USER_MODES "None"
#define CHANNEL_MODES "l"
#define CHANNEL_MODES_WITH_PARAMS "l"
@@ -378,6 +378,12 @@ inline std::string ERR_PASSWDMISMATCH(Client* client)
return oss.str();
}
inline std::string ERR_INVALIDKEY(Client* client, const std::string& channel) {
std::ostringstream oss;
oss << ":" << SERVER_NAME << " 467 " << CLIENT_NICK(client) << " " << channel << " :Invalid key\r\n";
return oss.str();
}
inline std::string ERR_CHANNELISFULL(Client* client, const std::string& channel) {
std::ostringstream oss;
oss << ":" << SERVER_NAME << " 471 " << CLIENT_NICK(client) << " " << channel << " :Cannot join channel (channel is full)\r\n";
@@ -440,6 +446,12 @@ inline std::string ERR_USERSDONTMATCH(Client *client) {
return oss.str();
}
inline std::string ERR_INVALIDMODEPARAM(Client* client, const std::string& param) {
std::ostringstream oss;
oss << ":" << SERVER_NAME << " 696 " << CLIENT_NICK(client) << " " << param << " :Invalid mode parameter\r\n";
return oss.str();
}
// PONG Reply
inline std::string RPL_PONG(const std::string& token)
{