Skip to content

Commit

Permalink
Merge pull request #134 from jdomingu98/120-privmsg-bug-cuando-se-env…
Browse files Browse the repository at this point in the history
…a-un-mensaje-a-un-canal-le-llega-a-si-mismo

bug privMsg to channel
  • Loading branch information
Atrujillo02 authored Apr 25, 2024
2 parents ac601b6 + 239faed commit c8c3653
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/User.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,6 @@ void User::sendPrivateMessageToChannel(const Channel &destination, const std::st
std::string response = PRIVMSG_MSG(this->_nickname, this->_username, this->_hostname, destination.getName(), message);
std::vector<User> users = destination.getAllUsers();
for (size_t i = 0; i < users.size(); i++)
Server::getInstance().sendMessage(users[i].getFd(), response);
if (users[i].getNickname() != this->_nickname)
Server::getInstance().sendMessage(users[i].getFd(), response);
}

0 comments on commit c8c3653

Please sign in to comment.