diff options
author | Florent Le Coz <louiz@louiz.org> | 2015-10-12 16:47:27 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2015-10-12 16:47:27 +0200 |
commit | 84aafab6040f8fd126e6c4941631d44f122c4b9a (patch) | |
tree | e2fbeac7dff1d33b76dec40cf6f91244455bc792 /src/xmpp | |
parent | 6512f830fa2baa85a7c688843ebd42eb528e2ad6 (diff) | |
download | biboumi-84aafab6040f8fd126e6c4941631d44f122c4b9a.tar.gz biboumi-84aafab6040f8fd126e6c4941631d44f122c4b9a.tar.bz2 biboumi-84aafab6040f8fd126e6c4941631d44f122c4b9a.tar.xz biboumi-84aafab6040f8fd126e6c4941631d44f122c4b9a.zip |
Provide the “realname_customization” option
ref #3136
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/biboumi_adhoc_commands.cpp | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index 19e6a71..0a23715 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -1,6 +1,7 @@ #include <xmpp/biboumi_adhoc_commands.hpp> #include <xmpp/biboumi_component.hpp> #include <bridge/bridge.hpp> +#include <config/config.hpp> #include <utils/string.hpp> #include <utils/split.hpp> #include <xmpp/jid.hpp> @@ -191,31 +192,34 @@ 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()) + if (Config::get("realname_customization", "true") == "true") { - 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 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)); + 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)); } - realname.add_child(required); - x.add_child(std::move(realname)); command_node.add_child(std::move(x)); } |