From 9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Thu, 6 Jul 2017 22:24:42 +0200 Subject: =?UTF-8?q?Add=20a=20global=20=E2=80=9Cpersistent=E2=80=9D=20optio?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/xmpp/biboumi_adhoc_commands.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/xmpp') diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index ad4faf8..c1b7323 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -147,6 +147,21 @@ void ConfigureGlobalStep1(XmppComponent&, AdhocSession& session, XmlNode& comman else value.set_inner("false"); } + + XmlSubNode persistent(x, "field"); + persistent["var"] = "persistent"; + persistent["type"] = "boolean"; + persistent["label"] = "Make all channels persistent"; + persistent["desc"] = "If true, all channels will be persistent"; + + { + XmlSubNode value(persistent, "value"); + value.set_name("value"); + if (options.col()) + value.set_inner("true"); + else + value.set_inner("false"); + } } void ConfigureGlobalStep2(XmppComponent& xmpp_component, AdhocSession& session, XmlNode& command_node) @@ -173,6 +188,9 @@ void ConfigureGlobalStep2(XmppComponent& xmpp_component, AdhocSession& session, if (bridge) bridge->set_record_history(options.col()); } + else if (field->get_tag("var") == "persistent" && + value) + options.col() = to_bool(value->get_inner()); } options.save(Database::db); -- cgit v1.2.3