IRC nicks cannot contain spaces
Rather than trying and hoping the server gives a proper failure, just fail early and avoid the whole mess. Some servers will instead send messages to the user, etc, which is not very helpful.
This commit is contained in:
@@ -526,6 +526,11 @@ void IrcClient::send_user_command(const std::string& username, const std::string
|
||||
|
||||
void IrcClient::send_nick_command(const std::string& nick)
|
||||
{
|
||||
if (nick.find(' ') != std::string::npos)
|
||||
{
|
||||
this->on_erroneous_nickname(IrcMessage(std::string(this->hostname), "432", {this->get_own_nick(), nick, "Erroneous nickname"}));
|
||||
return;
|
||||
}
|
||||
this->send_message(IrcMessage("NICK", {nick}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user