Allow to override the addresses used to connect to an IRC network

fix #3273
This commit is contained in:
louiz’
2018-03-12 01:00:17 +01:00
parent 9e4a3e2b05
commit bb476f4a0d
5 changed files with 43 additions and 8 deletions
+18
View File
@@ -227,6 +227,19 @@ 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 " + server_domain);
{
XmlSubNode hostname(x, "field");
hostname["var"] = "hostname";
hostname["type"] = "text-single";
hostname["label"] = "Address";
hostname["desc"] = "The hostname (or IP) to connect to.";
XmlSubNode value(hostname, "value");
if (options.col<Database::Address>().empty())
value.set_inner(server_domain);
else
value.set_inner(options.col<Database::Address>());
}
{
XmlSubNode ports(x, "field");
ports["var"] = "ports";
@@ -375,6 +388,11 @@ void ConfigureIrcServerStep2(XmppComponent&, AdhocSession& session, XmlNode& com
{
const XmlNode* value = field->get_child("value", "jabber:x:data");
const std::vector<const XmlNode*> values = field->get_children("value", "jabber:x:data");
if (field->get_tag("var") == "hostname")
{
options.col<Database::Address>() = value->get_inner();
}
if (field->get_tag("var") == "ports")
{
std::string ports;