now broadcast send message to every member of channel, excluding the author of message

This commit is contained in:
aortigos
2026-05-15 23:11:02 +02:00
parent 9a2d7919fb
commit a21bac6e47
8 changed files with 65 additions and 14 deletions

View File

@@ -57,7 +57,14 @@ void Channel::addOperator(int fd) { this->operators_.insert(fd); }
void Channel::removeOperator(int fd) { this->operators_.erase(fd); }
bool Channel::hasOperator(int fd) const { return (this->operators_.count(fd) > 0); }
void Channel::broadcast()
void Channel::broadcast(const std::string &msg, std::map<int, User> &clients, int excludedFd)
{
return ;
}
for (std::set<int>::iterator member = members_.begin(); member != members_.end(); member++)
{
if ((*member) == excludedFd) continue;
std::map<int, User>::iterator user = clients.find(*member);
if (user != clients.end())
user->second.send(msg);
}
}