diff options
author | louiz’ <louiz@louiz.org> | 2021-01-15 12:33:18 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2021-01-15 12:33:18 +0100 |
commit | a4512cd3ae7294cf8872fd45e4b4783bddd48ec4 (patch) | |
tree | ab8f1fbecb90c9ffa5deca7fac89ef3e0384f20a /src | |
parent | 1b1b03b21b5e482dda75796b1287aa9bc6cfd847 (diff) | |
download | biboumi-a4512cd3ae7294cf8872fd45e4b4783bddd48ec4.tar.gz biboumi-a4512cd3ae7294cf8872fd45e4b4783bddd48ec4.tar.bz2 biboumi-a4512cd3ae7294cf8872fd45e4b4783bddd48ec4.tar.xz biboumi-a4512cd3ae7294cf8872fd45e4b4783bddd48ec4.zip |
sasl: Use the nick from the presence if the ad-hoc one is not set
fix #3450
Diffstat (limited to 'src')
-rw-r--r-- | src/irc/irc_client.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 1f2a21b..8a64727 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -1371,7 +1371,8 @@ void IrcClient::on_authenticate(const IrcMessage &) auto options = Database::get_irc_server_options(this->bridge.get_bare_jid(), this->get_hostname()); - const auto auth_string = '\0' + options.col<Database::Nick>() + '\0' + options.col<Database::SaslPassword>(); + const auto& nick = !options.col<Database::Nick>().empty() ? options.col<Database::Nick>() : this->get_own_nick(); + const auto auth_string = '\0' + nick + '\0' + options.col<Database::SaslPassword>(); const auto base64_auth_string = base64::encode(auth_string); this->send_message({"AUTHENTICATE", {base64_auth_string}}); } |