Channel changes and init JOIN command

This commit is contained in:
2026-05-15 15:35:58 +02:00
parent b1f2d3ad1f
commit 2b44730e1a
5 changed files with 81 additions and 34 deletions

View File

@@ -16,13 +16,16 @@
# include <iostream>
# include <set>
# include <map>
# include "../User/User.hpp"
class Channel
{
private:
std::string name_;
std::set<int> members_;
std::set<int> operators_;
std::set<int> members_;
std::set<int> operators_;
public:
Channel();
@@ -31,15 +34,22 @@ class Channel
Channel& operator=(const Channel &other);
~Channel();
// Getters
std::string getName() const { return (this->name); }
// Users
void addMember(int fd);
void removeMember(int fd);
bool hasMember(int fd) const;
void addMember(int fd);
void removeMember(int fd);
bool hasMember(int fd) const;
// Operators
void addOperator(int fd);
void removeOperator(int fd);
bool hasOperator(int fd) const;
void addOperator(int fd);
void removeOperator(int fd);
bool hasOperator(int fd) const;
void broadcast(const std::string &msg, const std::map<int, User>& clients_, int excludeFd);
};