the password mode is working, and the invite mode bug is fixed

This commit is contained in:
Mmokane
2024-04-21 20:55:31 +01:00
parent 7440b0c891
commit 11789fe633
3 changed files with 63 additions and 62 deletions

View File

@@ -25,6 +25,7 @@ private:
std::string topic;
std::string key;
std::vector<std::string> users;
std::string pass;
// std::map<int, std::string> nicknames; // Replace unordered_map with map
std::map<std::string, int> userFdMap; // Mapping of usernames to file descriptors
std::map<std::string, int> invitedUsers;
@@ -45,12 +46,21 @@ public:
topic = newTopic;
}
void setPass(const std::string &Newpass)
{
pass = Newpass;
}
// Get topic function
std::string getTopic() const {
return topic;
}
std::string getPass()
{
return pass;
}
void addClient(const std::string& client, int fd) {
userFdMap[client] = fd;
}