/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Channel.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/15 12:41:35 by fgras-ca #+# #+# */ /* Updated: 2024/05/30 13:09:11 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef CHANNEL_HPP #define CHANNEL_HPP #include #include #include #include #include #include "RPL.hpp" #include "Client.hpp" #include "Server.hpp" class Server; class Client; class Channel { public: Channel(const std::string &name); ~Channel(); const std::string &getName() const; void addClient(Client *client); void removeClient(Client *client); bool isEmpty() const; const std::vector &getClients() const; void addOperator(Client *client); bool isOperator(Client *client) const; bool hasClient(Client *client) const; void broadcast(const std::string &message, Client *_client, Server *_server); // Ajouts bool isBanned(Client *client) const; bool isFull() const; bool isInviteOnly() const; bool isInvited(Client *client) const; bool checkKey(const std::string &key) const; const std::string &getTopic() const; const std::string &getTopicSetter() const; time_t getTopicTime() const; void setTopic(const std::string &topic, const std::string &setter); void setClientLimit(size_t limit); // Ajouté size_t getClientLimit() const; // Ajouté void setInviteOnly(bool inviteOnly); // Ajouté void setKey(const std::string &key); // Ajouté void setTopicProtection(bool protection); // Ajouté std::string getModes() const; // Ajouté void addInvitedClient(Client* client); private: std::string _name; std::vector _clients; std::vector _operators; std::set _bannedClients; std::set _invitedClients; std::string _key; std::string _topic; std::string _topicSetter; time_t _topicTime; size_t _clientLimit; bool _inviteOnly; bool _topicProtection; // Ajouté }; #endif // CHANNEL_HPP