diff options
author | Florent Le Coz <louiz@louiz.org> | 2015-12-28 16:23:04 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2016-01-04 13:47:26 +0100 |
commit | cb0209bbbe4391436326350d6e176c90b8e8e88b (patch) | |
tree | 3e6600ee5683abe13d44c0be9c0328dfefa956cc | |
parent | 1fc3fa1bd8d98d45d18e8af76202cbf6b757b369 (diff) | |
download | biboumi-cb0209bbbe4391436326350d6e176c90b8e8e88b.tar.gz biboumi-cb0209bbbe4391436326350d6e176c90b8e8e88b.tar.bz2 biboumi-cb0209bbbe4391436326350d6e176c90b8e8e88b.tar.xz biboumi-cb0209bbbe4391436326350d6e176c90b8e8e88b.zip |
Also provide in and out encoding configure options for IRC servers
-rw-r--r-- | src/xmpp/biboumi_adhoc_commands.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp index d115ae7..be755e9 100644 --- a/src/xmpp/biboumi_adhoc_commands.cpp +++ b/src/xmpp/biboumi_adhoc_commands.cpp @@ -233,6 +233,35 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com x.add_child(std::move(realname)); } + XmlNode encoding_out("field"); + encoding_out["var"] = "encoding_out"; + encoding_out["type"] = "text-single"; + encoding_out["desc"] = "The encoding used when sending messages to the IRC server."; + encoding_out["label"] = "Out encoding"; + if (!options.encodingOut.value().empty()) + { + XmlNode encoding_out_value("value"); + encoding_out_value.set_inner(options.encodingOut.value()); + encoding_out.add_child(std::move(encoding_out_value)); + } + encoding_out.add_child(required); + x.add_child(std::move(encoding_out)); + + XmlNode encoding_in("field"); + encoding_in["var"] = "encoding_in"; + encoding_in["type"] = "text-single"; + encoding_in["desc"] = "The encoding used to decode message received from the IRC server."; + encoding_in["label"] = "In encoding"; + if (!options.encodingIn.value().empty()) + { + XmlNode encoding_in_value("value"); + encoding_in_value.set_inner(options.encodingIn.value()); + encoding_in.add_child(std::move(encoding_in_value)); + } + encoding_in.add_child(required); + x.add_child(std::move(encoding_in)); + + command_node.add_child(std::move(x)); } @@ -294,6 +323,15 @@ void ConfigureIrcServerStep2(XmppComponent&, AdhocSession& session, XmlNode& com else if (field->get_tag("var") == "realname" && value && !value->get_inner().empty()) options.realname = value->get_inner(); + + else if (field->get_tag("var") == "encoding_out" && + value && !value->get_inner().empty()) + options.encodingOut = value->get_inner(); + + else if (field->get_tag("var") == "encoding_in" && + value && !value->get_inner().empty()) + options.encodingIn = value->get_inner(); + } options.update(); |