Add support for password-protected IRC rooms.

This commit is contained in:
Emmanuel Gil Peyrot
2015-01-14 12:38:46 +01:00
parent e2e2f30894
commit e4fcbd3030
5 changed files with 9 additions and 7 deletions
+2 -2
View File
@@ -206,12 +206,12 @@ void IrcClient::send_quit_command(const std::string& reason)
this->send_message(IrcMessage("QUIT", {reason}));
}
void IrcClient::send_join_command(const std::string& chan_name)
void IrcClient::send_join_command(const std::string& chan_name, const std::string& password)
{
if (this->welcomed == false)
this->channels_to_join.push_back(chan_name);
else
this->send_message(IrcMessage("JOIN", {chan_name}));
this->send_message(IrcMessage("JOIN", {chan_name, password}));
this->start();
}
+1 -1
View File
@@ -81,7 +81,7 @@ public:
/**
* Send the JOIN irc command.
*/
void send_join_command(const std::string& chan_name);
void send_join_command(const std::string& chan_name, const std::string& password = "");
/**
* Send a PRIVMSG command for a channel
* Return true if the message was actually sent