summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-09-23 18:24:06 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-09-23 18:47:29 +0200
commitf904d57940699e332f75a77062912431c6e51188 (patch)
tree6e3dc737fcbf77344fadb88d015b80e603b70589 /src/irc/irc_client.cpp
parentf6d9b7d7a1d670b3b3d2bd1ca831de8578de6206 (diff)
downloadbiboumi-f904d57940699e332f75a77062912431c6e51188.tar.gz
biboumi-f904d57940699e332f75a77062912431c6e51188.tar.bz2
biboumi-f904d57940699e332f75a77062912431c6e51188.tar.xz
biboumi-f904d57940699e332f75a77062912431c6e51188.zip
Provide username and realname IRC server options
Used in the USER command when connecting to the IRC server, instead of the first nick. fix #3028
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index b4df7dd..00d9f43 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -116,7 +116,17 @@ void IrcClient::on_connected()
this->send_pass_command(options.pass.value());
#endif
this->send_nick_command(this->username);
+#ifdef USE_DATABASE
+ std::string username = this->username;
+ if (!options.username.value().empty())
+ username = options.username.value();
+ std::string realname = this->username;
+ if (!options.realname.value().empty())
+ realname = options.realname.value();
+ this->send_user_command(username, realname);
+#else
this->send_user_command(this->username, this->username);
+#endif // USE_DATABASE
this->send_gateway_message("Connected to IRC server"s + (this->use_tls ? " (encrypted)": "") + ".");
this->send_pending_data();
}