This commit is contained in:
Ladebeze66
2024-05-21 14:45:16 +02:00
parent 4c13e1b349
commit 0dc9f5c940
17 changed files with 324 additions and 427 deletions

View File

@@ -6,7 +6,7 @@
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/15 18:14:12 by fgras-ca #+# #+# */
/* Updated: 2024/05/19 19:13:53 by fgras-ca ### ########.fr */
/* Updated: 2024/05/21 13:47:12 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -18,7 +18,7 @@
#include "Client.hpp"
#include "Channel.hpp"
#include "AdditionalCommands.hpp"
#include "ModeWhoHandler.hpp"
#include "Who.hpp"
#include "CommandHandler.hpp"
#include "RPL.hpp"

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/19 22:27:05 by fgras-ca ### ########.fr */
/* Updated: 2024/05/21 12:41:51 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
@@ -19,9 +19,9 @@
#define SERVER_NAME "IRC_Server"
#define SERVER_VERSION "1.0"
#define USER_MODES "iw"
#define CHANNEL_MODES "nt"
#define CHANNEL_MODES_WITH_PARAMS "kl"
#define USER_MODES ""
#define CHANNEL_MODES ""
#define CHANNEL_MODES_WITH_PARAMS ""
@@ -35,7 +35,7 @@
// Fonctions pour générer les réponses RPL
inline std::string RPL_WELCOME(Client* client) {
std::ostringstream oss;
oss << ":" << SERVER_NAME << " 001 " << CLIENT_FD(client)
oss << ":" << SERVER_NAME << " 001 " << CLIENT_NICK(client)
<< " :Welcome to the Internet Relay Network " << CLIENT_NICK(client)
<< "!" << CLIENT_USER(client) << "@" << CLIENT_HOST(client) << "\r\n";
return oss.str();

View File

@@ -1,17 +1,17 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ModeWhoHandler.hpp :+: :+: :+: */
/* Who.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/05/17 16:08:48 by fgras-ca #+# #+# */
/* Updated: 2024/05/19 20:36:23 by fgras-ca ### ########.fr */
/* Updated: 2024/05/21 13:47:28 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MODEWHOHANDLER_HPP
#define MODEWHOHANDLER_HPP
#ifndef WHO_HPP
#define WHO_HPP
#include "Server.hpp"
#include "Client.hpp"
@@ -24,11 +24,10 @@
class Server;
class ModeWhoHandler
class WhoHandler
{
public:
ModeWhoHandler(Server *server);
void handleModeCommand(Client *client, const std::string &command);
WhoHandler(Server *server);
void handleWhoCommand(Client *client, const std::string &command);
void handleWhoisCommand(Client *client, const std::string &command);