Add some scopes around various XmlSubNode
This commit is contained in:
@@ -122,23 +122,24 @@ void ConfigureGlobalStep1(XmppComponent&, AdhocSession& session, XmlNode& comman
|
||||
XmlSubNode instructions(x, "instructions");
|
||||
instructions.set_inner("Edit the form, to configure your global settings for the component.");
|
||||
|
||||
{
|
||||
XmlSubNode max_histo_length(x, "field");
|
||||
max_histo_length["var"] = "max_history_length";
|
||||
max_histo_length["type"] = "text-single";
|
||||
max_histo_length["label"] = "Max history length";
|
||||
max_histo_length["desc"] = "The maximum number of lines in the history that the server sends when joining a channel";
|
||||
|
||||
{
|
||||
XmlSubNode value(max_histo_length, "value");
|
||||
value.set_inner(std::to_string(options.col<Database::MaxHistoryLength>()));
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode record_history(x, "field");
|
||||
record_history["var"] = "record_history";
|
||||
record_history["type"] = "boolean";
|
||||
record_history["label"] = "Record history";
|
||||
record_history["desc"] = "Whether to save the messages into the database, or not";
|
||||
|
||||
{
|
||||
XmlSubNode value(record_history, "value");
|
||||
value.set_name("value");
|
||||
@@ -147,13 +148,14 @@ 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");
|
||||
@@ -163,6 +165,7 @@ void ConfigureGlobalStep1(XmppComponent&, AdhocSession& session, XmlNode& comman
|
||||
value.set_inner("false");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureGlobalStep2(XmppComponent& xmpp_component, AdhocSession& session, XmlNode& command_node)
|
||||
{
|
||||
@@ -224,6 +227,7 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
XmlSubNode instructions(x, "instructions");
|
||||
instructions.set_inner("Edit the form, to configure the settings of the IRC server "s + server_domain);
|
||||
|
||||
{
|
||||
XmlSubNode ports(x, "field");
|
||||
ports["var"] = "ports";
|
||||
ports["type"] = "text-multi";
|
||||
@@ -234,8 +238,10 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
XmlSubNode ports_value(ports, "value");
|
||||
ports_value.set_inner(val);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BOTAN_FOUND
|
||||
{
|
||||
XmlSubNode tls_ports(x, "field");
|
||||
tls_ports["var"] = "tls_ports";
|
||||
tls_ports["type"] = "text-multi";
|
||||
@@ -246,7 +252,9 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
XmlSubNode tls_ports_value(tls_ports, "value");
|
||||
tls_ports_value.set_inner(val);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode verify_cert(x, "field");
|
||||
verify_cert["var"] = "verify_cert";
|
||||
verify_cert["type"] = "boolean";
|
||||
@@ -257,7 +265,9 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
verify_cert_value.set_inner("true");
|
||||
else
|
||||
verify_cert_value.set_inner("false");
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode fingerprint(x, "field");
|
||||
fingerprint["var"] = "fingerprint";
|
||||
fingerprint["type"] = "text-single";
|
||||
@@ -267,8 +277,9 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
XmlSubNode fingerprint_value(fingerprint, "value");
|
||||
fingerprint_value.set_inner(options.col<Database::TrustedFingerprint>());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
{
|
||||
XmlSubNode pass(x, "field");
|
||||
pass["var"] = "pass";
|
||||
pass["type"] = "text-private";
|
||||
@@ -279,7 +290,9 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
XmlSubNode pass_value(pass, "value");
|
||||
pass_value.set_inner(options.col<Database::Pass>());
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode after_cnt_cmd(x, "field");
|
||||
after_cnt_cmd["var"] = "after_connect_command";
|
||||
after_cnt_cmd["type"] = "text-single";
|
||||
@@ -290,8 +303,10 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
XmlSubNode after_cnt_cmd_value(after_cnt_cmd, "value");
|
||||
after_cnt_cmd_value.set_inner(options.col<Database::AfterConnectionCommand>());
|
||||
}
|
||||
}
|
||||
|
||||
if (Config::get("realname_customization", "true") == "true")
|
||||
{
|
||||
{
|
||||
XmlSubNode username(x, "field");
|
||||
username["var"] = "username";
|
||||
@@ -302,7 +317,9 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
XmlSubNode username_value(username, "value");
|
||||
username_value.set_inner(options.col<Database::Username>());
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode realname(x, "field");
|
||||
realname["var"] = "realname";
|
||||
realname["type"] = "text-single";
|
||||
@@ -313,7 +330,9 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
realname_value.set_inner(options.col<Database::Realname>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode encoding_out(x, "field");
|
||||
encoding_out["var"] = "encoding_out";
|
||||
encoding_out["type"] = "text-single";
|
||||
@@ -324,7 +343,9 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
XmlSubNode encoding_out_value(encoding_out, "value");
|
||||
encoding_out_value.set_inner(options.col<Database::EncodingOut>());
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode encoding_in(x, "field");
|
||||
encoding_in["var"] = "encoding_in";
|
||||
encoding_in["type"] = "text-single";
|
||||
@@ -336,6 +357,7 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
|
||||
encoding_in_value.set_inner(options.col<Database::EncodingIn>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureIrcServerStep2(XmppComponent&, AdhocSession& session, XmlNode& command_node)
|
||||
{
|
||||
@@ -444,7 +466,6 @@ void insert_irc_channel_configuration_form(XmlNode& node, const Jid& requester,
|
||||
|
||||
auto options = Database::get_irc_channel_options_with_server_default(requester.local + "@" + requester.domain,
|
||||
iid.get_server(), iid.get_local());
|
||||
|
||||
XmlSubNode x(node, "jabber:x:data:x");
|
||||
x["type"] = "form";
|
||||
XmlSubNode title(x, "title");
|
||||
@@ -452,12 +473,12 @@ void insert_irc_channel_configuration_form(XmlNode& node, const Jid& requester,
|
||||
XmlSubNode instructions(x, "instructions");
|
||||
instructions.set_inner("Edit the form, to configure the settings of the IRC channel "s + iid.get_local());
|
||||
|
||||
{
|
||||
XmlSubNode record_history(x, "field");
|
||||
record_history["var"] = "record_history";
|
||||
record_history["type"] = "list-single";
|
||||
record_history["label"] = "Record history for this channel";
|
||||
record_history["desc"] = "If unset, the value is the one configured globally";
|
||||
|
||||
{
|
||||
// Value selected by default
|
||||
XmlSubNode value(record_history, "value");
|
||||
@@ -471,7 +492,9 @@ void insert_irc_channel_configuration_form(XmlNode& node, const Jid& requester,
|
||||
XmlSubNode value(option, "value");
|
||||
value.set_inner(val);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode encoding_out(x, "field");
|
||||
encoding_out["var"] = "encoding_out";
|
||||
encoding_out["type"] = "text-single";
|
||||
@@ -482,7 +505,9 @@ void insert_irc_channel_configuration_form(XmlNode& node, const Jid& requester,
|
||||
XmlSubNode encoding_out_value(encoding_out, "value");
|
||||
encoding_out_value.set_inner(options.col<Database::EncodingOut>());
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode encoding_in(x, "field");
|
||||
encoding_in["var"] = "encoding_in";
|
||||
encoding_in["type"] = "text-single";
|
||||
@@ -493,7 +518,9 @@ void insert_irc_channel_configuration_form(XmlNode& node, const Jid& requester,
|
||||
XmlSubNode encoding_in_value(encoding_in, "value");
|
||||
encoding_in_value.set_inner(options.col<Database::EncodingIn>());
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
XmlSubNode persistent(x, "field");
|
||||
persistent["var"] = "persistent";
|
||||
persistent["type"] = "boolean";
|
||||
@@ -508,6 +535,7 @@ void insert_irc_channel_configuration_form(XmlNode& node, const Jid& requester,
|
||||
value.set_inner("false");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigureIrcChannelStep2(XmppComponent& xmpp_component, AdhocSession& session, XmlNode& command_node)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user