summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-03-12 01:00:17 +0100
committerlouiz’ <louiz@louiz.org>2018-03-12 01:00:17 +0100
commitbb476f4a0d60bbc41393a86a370aa94ab405b081 (patch)
tree82d15a2f36ae284ac693927c367bb57b89ddda51 /src/xmpp
parent9e4a3e2b054ee4604b6a42c73895216c68fa96e7 (diff)
downloadbiboumi-bb476f4a0d60bbc41393a86a370aa94ab405b081.tar.gz
biboumi-bb476f4a0d60bbc41393a86a370aa94ab405b081.tar.bz2
biboumi-bb476f4a0d60bbc41393a86a370aa94ab405b081.tar.xz
biboumi-bb476f4a0d60bbc41393a86a370aa94ab405b081.zip
Allow to override the addresses used to connect to an IRC network
fix #3273
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 bcdac39..0a25bd4 100644
--- a/src/xmpp/biboumi_adhoc_commands.cpp
+++ b/src/xmpp/biboumi_adhoc_commands.cpp
@@ -228,6 +228,19 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
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";
ports["type"] = "text-multi";
@@ -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;