make the invited user if it kicked from the channed and the channel is restrected by the +i need to be invited again to join the channel again

This commit is contained in:
mochaoui
2024-04-21 10:53:49 -05:00
parent a8b3f537c2
commit da836982d9
2 changed files with 18 additions and 3 deletions

View File

@@ -130,7 +130,7 @@ public:
}
void ejectUser(int fd) {
void ejectUserfromusers(int fd) {
// Iterate over the map to find the user with the given file descriptor
std::map<std::string, int>::iterator it;
for (it = userFdMap.begin(); it != userFdMap.end(); ++it) {
@@ -143,6 +143,19 @@ public:
}
}
void ejectUserfromivited(std::string nickname) {
// Iterate over the map to find the user with the given file descriptor
std::map<std::string, int>::iterator it;
for (it = invitedUsers.begin(); it != invitedUsers.end(); ++it) {
if (it->first == nickname) {
// Erase the user from the map
invitedUsers.erase(it);
std::cout << "the user earased " << std::endl;
return; // Exit the function after removing the user
}
}
}
std::string getOperatorNickname(int fd) const {
std::map<std::string, int>::const_iterator it;
for (it = operators.begin(); it != operators.end(); ++it) {