summaryrefslogtreecommitdiff
path: root/src/xmpp/biboumi_adhoc_commands.cpp
diff options
context:
space:
mode:
authorlouiz <louiz@louiz.org>2017-03-27 14:55:43 +0200
committerlouiz <louiz@louiz.org>2017-03-27 14:55:43 +0200
commit4baedc45d01a08d56d9e83f2f83ba9e303eebbcb (patch)
tree7b45e37de97c881c7587e126596a6d6f202e38a7 /src/xmpp/biboumi_adhoc_commands.cpp
parent1017e8f46bb6c4c9f878cba5e70f7c3a4c831433 (diff)
parent55f74349259fa0037de98d30d70b50396c4804f5 (diff)
downloadbiboumi-4baedc45d01a08d56d9e83f2f83ba9e303eebbcb.tar.gz
biboumi-4baedc45d01a08d56d9e83f2f83ba9e303eebbcb.tar.bz2
biboumi-4baedc45d01a08d56d9e83f2f83ba9e303eebbcb.tar.xz
biboumi-4baedc45d01a08d56d9e83f2f83ba9e303eebbcb.zip
Merge branch 'persistent_chans' into 'master'
Add a Persistent option on channels Closes #3230 See merge request !6
Diffstat (limited to 'src/xmpp/biboumi_adhoc_commands.cpp')
-rw-r--r--src/xmpp/biboumi_adhoc_commands.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp
index a83af80..5ec11da 100644
--- a/src/xmpp/biboumi_adhoc_commands.cpp
+++ b/src/xmpp/biboumi_adhoc_commands.cpp
@@ -256,7 +256,8 @@ void ConfigureIrcServerStep1(XmppComponent&, AdhocSession& session, XmlNode& com
XmlSubNode pass(x, "field");
pass["var"] = "pass";
pass["type"] = "text-private";
- pass["label"] = "Server password (to be used in a PASS command when connecting)";
+ pass["label"] = "Server password";
+ pass["desc"] = "Will be used in a PASS command when connecting";
if (!options.pass.value().empty())
{
XmlSubNode pass_value(pass, "value");
@@ -463,6 +464,20 @@ void ConfigureIrcChannelStep1(XmppComponent&, AdhocSession& session, XmlNode& co
XmlSubNode encoding_in_value(encoding_in, "value");
encoding_in_value.set_inner(options.encodingIn.value());
}
+
+ XmlSubNode persistent(x, "field");
+ persistent["var"] = "persistent";
+ persistent["type"] = "boolean";
+ persistent["desc"] = "If set to true, when all XMPP clients have left this channel, biboumi will stay idle in it, without sending a PART command.";
+ persistent["label"] = "Persistent";
+ {
+ XmlSubNode value(persistent, "value");
+ value.set_name("value");
+ if (options.persistent.value())
+ value.set_inner("true");
+ else
+ value.set_inner("false");
+ }
}
void ConfigureIrcChannelStep2(XmppComponent&, AdhocSession& session, XmlNode& command_node)
@@ -486,6 +501,10 @@ void ConfigureIrcChannelStep2(XmppComponent&, AdhocSession& session, XmlNode& co
else if (field->get_tag("var") == "encoding_in" &&
value && !value->get_inner().empty())
options.encodingIn = value->get_inner();
+
+ else if (field->get_tag("var") == "persistent" &&
+ value)
+ options.persistent = to_bool(value->get_inner());
}
options.update();