summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-03-19 20:08:35 +0100
committerlouiz’ <louiz@louiz.org>2018-03-19 20:15:44 +0100
commit619c991a691a455efee2baa4e1fe96e64d27ff64 (patch)
tree57caded9a8d529e8793e920fc1df96d8903c2280 /src/xmpp
parentd7427fc9ca4c06fda458e4951559f57163d90b94 (diff)
downloadbiboumi-619c991a691a455efee2baa4e1fe96e64d27ff64.tar.gz
biboumi-619c991a691a455efee2baa4e1fe96e64d27ff64.tar.bz2
biboumi-619c991a691a455efee2baa4e1fe96e64d27ff64.tar.xz
biboumi-619c991a691a455efee2baa4e1fe96e64d27ff64.zip
Add a nick field in the IRC server configuration form
fix #3317
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/biboumi_adhoc_commands.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp
index d773ec3..66298d4 100644
--- a/src/xmpp/biboumi_adhoc_commands.cpp
+++ b/src/xmpp/biboumi_adhoc_commands.cpp
@@ -293,6 +293,20 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
}
}
#endif
+
+ {
+ XmlSubNode field(x, "field");
+ field["var"] = "nick";
+ field["type"] = "text-single";
+ field["label"] = "Nickname";
+ field["desc"] = "If set, will override the nickname provided in the initial presence sent to join the first server channel";
+ if (!options.col<Database::Nick>().empty())
+ {
+ XmlSubNode value(field, "value");
+ value.set_inner(options.col<Database::Nick>());
+ }
+ }
+
{
XmlSubNode pass(x, "field");
pass["var"] = "pass";
@@ -427,6 +441,8 @@ void ConfigureIrcServerStep2(XmppComponent&, AdhocSession& session, XmlNode& com
#endif // BOTAN_FOUND
+ else if (field->get_tag("var") == "nick" && value)
+ options.col<Database::Nick>() = value->get_inner();
else if (field->get_tag("var") == "pass" && value)
options.col<Database::Pass>() = value->get_inner();