Skip to content

Commit

Permalink
fix clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
Atrujillo02 committed Apr 23, 2024
1 parent d57b470 commit e21b5e3
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/commands/QuitCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ void QuitCommand::execute(int clientFd) {
usersChannel.clear();
}

if (allUsers.empty() && user.isRegistered()) {
server.sendMessage(clientFd,
QUIT_MSG(nickname, user.getUsername(), user.getHostname(),
_message.empty() ? nickname : _message));
}
if (allUsers.empty() && user.isRegistered())
allUsers.insert(user);

for (it = allUsers.begin(); it != allUsers.end(); it++) {
server.sendMessage(it->getFd(),
Expand Down

0 comments on commit e21b5e3

Please sign in to comment.