From 50cadf3dac0d56ef8181d1800cc30f8dcb749141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Tue, 13 Jun 2017 10:38:39 +0200 Subject: Implement our own database ORM, and update the whole code to use it Entirely replace LiteSQL fix #3271 --- src/irc/irc_client.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/irc/irc_client.cpp') diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp index 1d74098..bacb89e 100644 --- a/src/irc/irc_client.cpp +++ b/src/irc/irc_client.cpp @@ -156,11 +156,11 @@ IrcClient::IrcClient(std::shared_ptr& poller, std::string hostname, #ifdef USE_DATABASE auto options = Database::get_irc_server_options(this->bridge.get_bare_jid(), this->get_hostname()); - std::vector ports = utils::split(options.ports, ';', false); + std::vector ports = utils::split(options.col(), ';', false); for (auto it = ports.rbegin(); it != ports.rend(); ++it) this->ports_to_try.emplace(*it, false); # ifdef BOTAN_FOUND - ports = utils::split(options.tlsPorts, ';', false); + ports = utils::split(options.col(), ';', false); for (auto it = ports.rbegin(); it != ports.rend(); ++it) this->ports_to_try.emplace(*it, true); # endif // BOTAN_FOUND @@ -204,7 +204,7 @@ void IrcClient::start() # ifdef USE_DATABASE auto options = Database::get_irc_server_options(this->bridge.get_bare_jid(), this->get_hostname()); - this->credential_manager.set_trusted_fingerprint(options.trustedFingerprint); + this->credential_manager.set_trusted_fingerprint(options.col()); # endif #endif this->connect(this->hostname, port, tls); @@ -275,8 +275,8 @@ void IrcClient::on_connected() #ifdef USE_DATABASE auto options = Database::get_irc_server_options(this->bridge.get_bare_jid(), this->get_hostname()); - if (!options.pass.value().empty()) - this->send_pass_command(options.pass.value()); + if (!options.col().empty()) + this->send_pass_command(options.col()); #endif this->send_nick_command(this->current_nick); @@ -284,10 +284,10 @@ void IrcClient::on_connected() #ifdef USE_DATABASE if (Config::get("realname_customization", "true") == "true") { - if (!options.username.value().empty()) - this->username = options.username.value(); - if (!options.realname.value().empty()) - this->realname = options.realname.value(); + if (!options.col().empty()) + this->username = options.col(); + if (!options.col().empty()) + this->realname = options.col(); this->send_user_command(username, realname); } else @@ -894,8 +894,8 @@ void IrcClient::on_welcome_message(const IrcMessage& message) #ifdef USE_DATABASE auto options = Database::get_irc_server_options(this->bridge.get_bare_jid(), this->get_hostname()); - if (!options.afterConnectionCommand.value().empty()) - this->send_raw(options.afterConnectionCommand.value()); + if (!options.col().empty()) + this->send_raw(options.col()); #endif // Install a repeated events to regularly send a PING TimedEventsManager::instance().add_event(TimedEvent(240s, std::bind(&IrcClient::send_ping_command, this), @@ -1260,7 +1260,7 @@ bool IrcClient::abort_on_invalid_cert() const { #ifdef USE_DATABASE auto options = Database::get_irc_server_options(this->bridge.get_bare_jid(), this->hostname); - return options.verifyCert.value(); + return options.col(); #endif return true; } -- cgit v1.2.3