From e4a4addaf86abbee9d9bf5c486c5d1eaa78b6c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Wed, 6 Nov 2019 17:21:28 +0100 Subject: Add a missing max_history_length field in the IRC server option form --- src/xmpp/biboumi_adhoc_commands.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index ef230fe..113943c 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -387,6 +387,15 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com value.set_inner(std::to_string(options.col())); } + { + XmlSubNode max_history_length(x, "field"); + max_history_length["var"] = "max_history_length"; + max_history_length["type"] = "text-single"; + max_history_length["label"] = "Throttle limit"; + XmlSubNode value(max_history_length, "value"); + value.set_inner(std::to_string(options.col())); + } + { XmlSubNode encoding_out(x, "field"); encoding_out["var"] = "encoding_out"; @@ -514,6 +523,15 @@ void ConfigureIrcServerStep2(XmppComponent& xmpp_component, AdhocSession& sessio } } + else if (field->get_tag("var") == "max_history_length" && value) + { + try { + options.col() = std::stol(value->get_inner()); + } catch (const std::logic_error&) { + options.col() = 20; + } + } + else if (field->get_tag("var") == "encoding_out" && value) options.col() = value->get_inner(); -- cgit v1.2.3