/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* channel.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: sben-tay +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/05/20 22:18:17 by rparodi #+# #+# */ /* Updated: 2025/06/18 12:24:15 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #pragma once #include "user.hpp" #include "server.hpp" #include #include class Channel { public: Channel(const std::string &name, User *owner, size_t maxUsers, bool needInvite); // getters std::string getName() const; std::string getTopic() const; size_t getMaxUsers() const; User *getOwner() const; std::list getOperators() const; std::list& getUsers(); std::list getInvited() const; std::string getPassword() const; bool isOperator(User *user) const; bool isUserInChannel(User *user) const; bool getNeedInvite() const; bool getProtectTopic() const; // setters void setProtectTopic(bool toSet); void setMaxUser(size_t args); void setNeedInvite(bool toSet); void setTopic(const std::string &topic); void setPassword(const std::string &newPass); void addOperator(User *user); void addUser(User *user); void removeUser(User *user); void removeOperator(User *user); // utility functions void sendAllClientInAChannel(const std::string toSend, User *sender); private: std::string _name; User *_owner; std::string _password; size_t _maxUsers; bool _needInvite; bool _protectTopic; std::string _topic; std::list _operators; std::list _users; std::list _invited; };