Added working INVITE command

This commit is contained in:
iherman-
2026-05-23 21:38:02 +02:00
parent dd4de38e5f
commit bed4006e90
7 changed files with 86 additions and 10 deletions

View File

@@ -94,5 +94,10 @@ void Channel::setMode(std::string& mode, std::string& args)
(void) args;
}
void Channel::inviteMember(const User& client)
{
invitedMembers_.insert(client.getFd());
}
bool Channel::isInviteOnly() const { return isInviteOnly_; }
bool Channel::isInvited(int fd) const { return invitedMembers_.count(fd) > 0; }

View File

@@ -53,13 +53,12 @@ class Channel
void removeOperator(int fd);
bool hasOperator(int fd) const;
void inviteMember(User& client); // not implemented
void broadcast(const std::string &msg, const std::map<int, User> &clients, int excludedFd);
// modes
void setMode(std::string& mode, std::string& args);
void inviteMember(const User& client); // not implemented
bool isInviteOnly() const;
bool isInvited(int fd) const;