From bb476f4a0d60bbc41393a86a370aa94ab405b081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 12 Mar 2018 01:00:17 +0100 Subject: Allow to override the addresses used to connect to an IRC network fix #3273 --- src/xmpp/biboumi_adhoc_commands.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/xmpp/biboumi_adhoc_commands.cpp') diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index bcdac39..0a25bd4 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -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().empty()) + value.set_inner(server_domain); + else + value.set_inner(options.col()); + } + { 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 values = field->get_children("value", "jabber:x:data"); + + if (field->get_tag("var") == "hostname") + { + options.col() = value->get_inner(); + } if (field->get_tag("var") == "ports") { std::string ports; -- cgit v1.2.3