summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-04-20 10:12:00 +0200
committerlouiz’ <louiz@louiz.org>2017-04-20 10:12:00 +0200
commit5ef674c4862f1ad265e76ea6fabc20e180871243 (patch)
tree5ac2276a975be78c4a603a17adfa23c3a84e19ac
parente3ee824e5c5548c13605e4f2e2ded9491c1c1479 (diff)
downloadbiboumi-5ef674c4862f1ad265e76ea6fabc20e180871243.tar.gz
biboumi-5ef674c4862f1ad265e76ea6fabc20e180871243.tar.bz2
biboumi-5ef674c4862f1ad265e76ea6fabc20e180871243.tar.xz
biboumi-5ef674c4862f1ad265e76ea6fabc20e180871243.zip
Revert "Add a linger_time configuration option on IRC servers"
This reverts commit 5d801ddcd025f68d2ec91edf0462091a32c779c1.
-rw-r--r--database/database.xml1
-rw-r--r--src/bridge/bridge.cpp22
-rw-r--r--src/bridge/bridge.hpp5
-rw-r--r--src/xmpp/biboumi_adhoc_commands.cpp14
-rw-r--r--tests/end_to_end/__main__.py1
5 files changed, 1 insertions, 42 deletions
diff --git a/database/database.xml b/database/database.xml
index 0bc6e35..e641fdf 100644
--- a/database/database.xml
+++ b/database/database.xml
@@ -24,7 +24,6 @@
<field name="realname" type="string" length="1024" default=""/>
<field name="verifyCert" type="boolean" default="true"/>
<field name="trustedFingerprint" type="string"/>
- <field name="lingerTime" type="integer" default="0"/>
<field name="encodingOut" type="string" default="ISO-8859-1"/>
<field name="encodingIn" type="string" default="ISO-8859-1"/>
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 <database/database.hpp>
#include "result_set_management.hpp"
#include <algorithm>
-#include <utils/timed_events.hpp>
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:
/**
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp
index 85f945d..9432697 100644
--- a/src/xmpp/biboumi_adhoc_commands.cpp
+++ b/src/xmpp/biboumi_adhoc_commands.cpp
@@ -319,16 +319,6 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
XmlSubNode encoding_in_value(encoding_in, "value");
encoding_in_value.set_inner(options.encodingIn.value());
}
-
- XmlSubNode linger_time(x, "field");
- linger_time["var"] = "linger_time";
- linger_time["type"] = "text-single";
- linger_time["desc"] = "The number of seconds to wait before sending a QUIT command, after the last channel on that server has been left.";
- linger_time["label"] = "Linger time";
- {
- XmlSubNode linger_time_value(linger_time, "value");
- linger_time_value.set_inner(std::to_string(options.lingerTime.value()));
- }
}
void ConfigureIrcServerStep2(XmppComponent&, AdhocSession& session, XmlNode& command_node)
@@ -408,10 +398,6 @@ void ConfigureIrcServerStep2(XmppComponent&, AdhocSession& session, XmlNode& com
value && !value->get_inner().empty())
options.encodingIn = value->get_inner();
- else if (field->get_tag("var") == "linger_time" &&
- value && !value->get_inner().empty())
- options.lingerTime = value->get_inner();
-
}
options.update();
diff --git a/tests/end_to_end/__main__.py b/tests/end_to_end/__main__.py
index 240c979..0d3790b 100644
--- a/tests/end_to_end/__main__.py
+++ b/tests/end_to_end/__main__.py
@@ -2277,7 +2277,6 @@ if __name__ == '__main__':
"/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='realname']/dataform:value[text()='realname']",
"/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='encoding_in']/dataform:value[text()='latin-1']",
"/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='encoding_out']/dataform:value[text()='UTF-8']",
- "/iq/commands:command/dataform:x[@type='form']/dataform:field[@type='text-single'][@var='linger_time']/dataform:value[text()='0']",
"/iq/commands:command/commands:actions/commands:next",
),
after = partial(save_value, "sessionid", partial(extract_attribute, "/iq[@type='result']/commands:command[@node='configure']", "sessionid"))