Topic cmd

This commit is contained in:
aortigos
2026-05-25 10:31:42 +02:00
parent 1ad176b41d
commit 1497a3c979
6 changed files with 71 additions and 2 deletions

View File

@@ -33,6 +33,7 @@ Channel& Channel::operator=(const Channel &other)
name_ = other.name_;
members_ = other.members_;
operators_ = other.operators_;
topic_ = other.topic_;
isInviteOnly_ = other.isInviteOnly_;
invitedMembers_ = other.invitedMembers_;
}
@@ -81,6 +82,14 @@ void Channel::broadcast(const std::string &msg, const std::map<int, User> &clien
}
}
// Topic
void Channel::setTopic(std::string content) { this->topic_ = content; }
std::string Channel::getTopic() { return (this->topic_); }
// Mode
void Channel::setMode(std::string& mode, std::string& args)
{
bool value;

View File

@@ -28,6 +28,8 @@ class Channel
std::set<int> members_;
std::set<int> operators_;
std::string topic_;
bool isInviteOnly_;
std::set<int> invitedMembers_;
@@ -43,6 +45,10 @@ class Channel
std::string getName() const;
const std::set<int> &getMembers() const;
// Topic
void setTopic(std::string content);
std::string getTopic();
// Users
void addMember(int fd);
void removeMember(int fd);