From 5ef674c4862f1ad265e76ea6fabc20e180871243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Thu, 20 Apr 2017 10:12:00 +0200 Subject: Revert "Add a linger_time configuration option on IRC servers" This reverts commit 5d801ddcd025f68d2ec91edf0462091a32c779c1. --- src/bridge/bridge.cpp | 22 +--------------------- src/bridge/bridge.hpp | 5 ----- 2 files changed, 1 insertion(+), 26 deletions(-) (limited to 'src/bridge') diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index 0a9a412..e362822 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -12,7 +12,6 @@ #include #include "result_set_management.hpp" #include -#include using namespace std::string_literals; @@ -892,7 +891,7 @@ void Bridge::send_muc_leave(const Iid& iid, const std::string& nick, } IrcClient* irc = this->find_irc_client(iid.get_server()); if (self && irc && irc->number_of_joined_channels() == 0) - this->quit_or_start_linger_timer(iid.get_server()); + irc->send_quit_command(""); } void Bridge::send_nick_change(Iid&& iid, @@ -1244,22 +1243,3 @@ void Bridge::set_record_history(const bool val) this->record_history = val; } #endif - -void Bridge::quit_or_start_linger_timer(const std::string& irc_hostname) -{ -#ifdef USE_DATABASE - auto options = Database::get_irc_server_options(this->get_bare_jid(), - irc_hostname); - const auto timeout = std::chrono::seconds(options.lingerTime.value()); -#else - const auto timeout = 0s; -#endif - - const auto event_name = "IRCLINGER:" + irc_hostname + ".." + this->get_bare_jid(); - TimedEvent event(std::chrono::steady_clock::now() + timeout, [this, irc_hostname]() { - IrcClient* irc = this->find_irc_client(irc_hostname); - if (irc) - irc->send_quit_command(""); - }, event_name); - TimedEventsManager::instance().add_event(std::move(event)); -} diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp index ce9c605..033291c 100644 --- a/src/bridge/bridge.hpp +++ b/src/bridge/bridge.hpp @@ -236,11 +236,6 @@ public: #ifdef USE_DATABASE void set_record_history(const bool val); #endif - /** - * Start a timer that will send a QUIT command after the - * configured linger time is expired. - */ - void quit_or_start_linger_timer(const std::string& irc_hostname); private: /** -- cgit v1.2.3