The realname is also saved as an IrcClient member
This commit is contained in:
@@ -27,6 +27,7 @@ IrcClient::IrcClient(std::shared_ptr<Poller> poller, const std::string& hostname
|
|||||||
TCPSocketHandler(poller),
|
TCPSocketHandler(poller),
|
||||||
hostname(hostname),
|
hostname(hostname),
|
||||||
username(username),
|
username(username),
|
||||||
|
realname(username),
|
||||||
current_nick(username),
|
current_nick(username),
|
||||||
bridge(bridge),
|
bridge(bridge),
|
||||||
welcomed(false),
|
welcomed(false),
|
||||||
@@ -115,18 +116,18 @@ void IrcClient::on_connected()
|
|||||||
if (!options.pass.value().empty())
|
if (!options.pass.value().empty())
|
||||||
this->send_pass_command(options.pass.value());
|
this->send_pass_command(options.pass.value());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
this->send_nick_command(this->username);
|
this->send_nick_command(this->username);
|
||||||
|
|
||||||
#ifdef USE_DATABASE
|
#ifdef USE_DATABASE
|
||||||
std::string username = this->username;
|
|
||||||
if (!options.username.value().empty())
|
if (!options.username.value().empty())
|
||||||
username = options.username.value();
|
this->username = options.username.value();
|
||||||
std::string realname = this->username;
|
|
||||||
if (!options.realname.value().empty())
|
if (!options.realname.value().empty())
|
||||||
realname = options.realname.value();
|
this->realname = options.realname.value();
|
||||||
this->send_user_command(username, realname);
|
this->send_user_command(username, realname);
|
||||||
#else
|
#endif
|
||||||
this->send_user_command(this->username, this->username);
|
this->send_user_command(this->username, this->realname);
|
||||||
#endif // USE_DATABASE
|
|
||||||
this->send_gateway_message("Connected to IRC server"s + (this->use_tls ? " (encrypted)": "") + ".");
|
this->send_gateway_message("Connected to IRC server"s + (this->use_tls ? " (encrypted)": "") + ".");
|
||||||
this->send_pending_data();
|
this->send_pending_data();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -254,9 +254,13 @@ private:
|
|||||||
*/
|
*/
|
||||||
const std::string hostname;
|
const std::string hostname;
|
||||||
/**
|
/**
|
||||||
* The user name used in the USER irc command
|
* The username used in the USER irc command
|
||||||
*/
|
*/
|
||||||
const std::string username;
|
std::string username;
|
||||||
|
/**
|
||||||
|
* The realname used in the USER irc command
|
||||||
|
*/
|
||||||
|
std::string realname;
|
||||||
/**
|
/**
|
||||||
* Our current nickname on the server
|
* Our current nickname on the server
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user