summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-07-06 22:24:42 +0200
committerlouiz’ <louiz@louiz.org>2017-07-06 22:24:42 +0200
commit9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c (patch)
treeba8c243c8633cb236bef629071a2a1264c459101 /src/xmpp
parentb71ca15a0f9114db38eec23b49d1489a2ff1d0ca (diff)
downloadbiboumi-9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c.tar.gz
biboumi-9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c.tar.bz2
biboumi-9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c.tar.xz
biboumi-9f7782bb0c5915969fd7477e0ed7c10b1a5c2d9c.zip
Add a global “persistent” option
Diffstat (limited to 'src/xmpp')
-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 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<Database::Persistent>())
+ 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<Database::RecordHistory>());
}
+ else if (field->get_tag("var") == "persistent" &&
+ value)
+ options.col<Database::Persistent>() = to_bool(value->get_inner());
}
options.save(Database::db);