diff options
author | Florent Le Coz <louiz@louiz.org> | 2015-09-21 18:56:37 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2015-09-21 18:56:37 +0200 |
commit | ceec98907776dcd73b0c02a46ca135196e5f223e (patch) | |
tree | 9e37f0052cd3a0e98b50fff1b9c39456ee3d395b /src/xmpp | |
parent | 890cfe90996ac4c3916c84d178049d9b3b23465b (diff) | |
download | biboumi-ceec98907776dcd73b0c02a46ca135196e5f223e.tar.gz biboumi-ceec98907776dcd73b0c02a46ca135196e5f223e.tar.bz2 biboumi-ceec98907776dcd73b0c02a46ca135196e5f223e.tar.xz biboumi-ceec98907776dcd73b0c02a46ca135196e5f223e.zip |
Add a field (in the configure form) to specifiy an after-connect IRC command
Diffstat (limited to 'src/xmpp')
-rw-r--r-- | src/xmpp/biboumi_adhoc_commands.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index 2964b22..55acd3d 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -177,6 +177,20 @@ void ConfigureIrcServerStep1(XmppComponent* xmpp_component, AdhocSession& sessio pass.add_child(required); x.add_child(std::move(pass)); + XmlNode after_cnt_cmd("field"); + after_cnt_cmd["var"] = "after_connect_command"; + after_cnt_cmd["type"] = "text-single"; + after_cnt_cmd["desc"] = "Custom IRC command sent after the connection is established with the server."; + after_cnt_cmd["label"] = "After-connection IRC command"; + if (!options.afterConnectionCommand.value().empty()) + { + XmlNode after_cnt_cmd_value("value"); + after_cnt_cmd_value.set_inner(options.afterConnectionCommand.value()); + after_cnt_cmd.add_child(std::move(after_cnt_cmd_value)); + } + after_cnt_cmd.add_child(required); + x.add_child(std::move(after_cnt_cmd)); + command_node.add_child(std::move(x)); } @@ -216,6 +230,10 @@ void ConfigureIrcServerStep2(XmppComponent* xmpp_component, AdhocSession& sessio else if (field->get_tag("var") == "pass" && value && !value->get_inner().empty()) options.pass = value->get_inner(); + + else if (field->get_tag("var") == "after_connect_command" && + value && !value->get_inner().empty()) + options.afterConnectionCommand = value->get_inner(); } options.update(); |