summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-03-08 15:39:50 +0100
committerlouiz’ <louiz@louiz.org>2017-03-27 11:49:07 +0200
commitb7789fe586f375f09134a0817bd3ac19850c048f (patch)
treefdd26bf038f7a151a374a91db478775caad6d236 /src/xmpp
parent1017e8f46bb6c4c9f878cba5e70f7c3a4c831433 (diff)
downloadbiboumi-b7789fe586f375f09134a0817bd3ac19850c048f.tar.gz
biboumi-b7789fe586f375f09134a0817bd3ac19850c048f.tar.bz2
biboumi-b7789fe586f375f09134a0817bd3ac19850c048f.tar.xz
biboumi-b7789fe586f375f09134a0817bd3ac19850c048f.zip
Add a Persistent option on channels
fix #3230
Diffstat (limited to 'src/xmpp')
-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();