summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2019-11-06 17:21:28 +0100
committerlouiz’ <louiz@louiz.org>2019-11-06 17:23:43 +0100
commite4a4addaf86abbee9d9bf5c486c5d1eaa78b6c2e (patch)
tree8a800e5ce3d892e9353b3edbf33d6055ec5d8383 /src
parent34b4caeccf03f4f6ae14e94b35ca1bb6e3cee1ec (diff)
downloadbiboumi-e4a4addaf86abbee9d9bf5c486c5d1eaa78b6c2e.tar.gz
biboumi-e4a4addaf86abbee9d9bf5c486c5d1eaa78b6c2e.tar.bz2
biboumi-e4a4addaf86abbee9d9bf5c486c5d1eaa78b6c2e.tar.xz
biboumi-e4a4addaf86abbee9d9bf5c486c5d1eaa78b6c2e.zip
Add a missing max_history_length field in the IRC server option form
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/biboumi_adhoc_commands.cpp18
1 files changed, 18 insertions, 0 deletions
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
@@ -388,6 +388,15 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
}
{
+ 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<Database::MaxHistoryLength>()));
+ }
+
+ {
XmlSubNode encoding_out(x, "field");
encoding_out["var"] = "encoding_out";
encoding_out["type"] = "text-single";
@@ -514,6 +523,15 @@ void ConfigureIrcServerStep2(XmppComponent& xmpp_component, AdhocSession& sessio
}
}
+ else if (field->get_tag("var") == "max_history_length" && value)
+ {
+ try {
+ options.col<Database::MaxHistoryLength>() = std::stol(value->get_inner());
+ } catch (const std::logic_error&) {
+ options.col<Database::MaxHistoryLength>() = 20;
+ }
+ }
+
else if (field->get_tag("var") == "encoding_out" && value)
options.col<Database::EncodingOut>() = value->get_inner();