diff options
author | Florent Le Coz <louiz@louiz.org> | 2015-09-23 18:24:06 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2015-09-23 18:47:29 +0200 |
commit | f904d57940699e332f75a77062912431c6e51188 (patch) | |
tree | 6e3dc737fcbf77344fadb88d015b80e603b70589 /src/xmpp | |
parent | f6d9b7d7a1d670b3b3d2bd1ca831de8578de6206 (diff) | |
download | biboumi-f904d57940699e332f75a77062912431c6e51188.tar.gz biboumi-f904d57940699e332f75a77062912431c6e51188.tar.bz2 biboumi-f904d57940699e332f75a77062912431c6e51188.tar.xz biboumi-f904d57940699e332f75a77062912431c6e51188.zip |
Provide username and realname IRC server options
Used in the USER command when connecting to the IRC server, instead of the
first nick.
fix #3028
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/biboumi_adhoc_commands.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index b7d2020..10951cd 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -189,6 +189,32 @@ void ConfigureIrcServerStep1(XmppComponent*, AdhocSession& session, XmlNode& com after_cnt_cmd.add_child(required); x.add_child(std::move(after_cnt_cmd)); + XmlNode username("field"); + username["var"] = "username"; + username["type"] = "text-single"; + username["label"] = "Username"; + if (!options.username.value().empty()) + { + XmlNode username_value("value"); + username_value.set_inner(options.username.value()); + username.add_child(std::move(username_value)); + } + username.add_child(required); + x.add_child(std::move(username)); + + XmlNode realname("field"); + realname["var"] = "realname"; + realname["type"] = "text-single"; + realname["label"] = "Realname"; + if (!options.realname.value().empty()) + { + XmlNode realname_value("value"); + realname_value.set_inner(options.realname.value()); + realname.add_child(std::move(realname_value)); + } + realname.add_child(required); + x.add_child(std::move(realname)); + command_node.add_child(std::move(x)); } @@ -230,6 +256,14 @@ void ConfigureIrcServerStep2(XmppComponent*, AdhocSession& session, XmlNode& com else if (field->get_tag("var") == "after_connect_command" && value && !value->get_inner().empty()) options.afterConnectionCommand = value->get_inner(); + + else if (field->get_tag("var") == "username" && + value && !value->get_inner().empty()) + options.username = value->get_inner(); + + else if (field->get_tag("var") == "realname" && + value && !value->get_inner().empty()) + options.realname = value->get_inner(); } options.update(); |