summaryrefslogtreecommitdiff
path: root/src/xmpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-03-17 17:33:17 +0100
committerlouiz’ <louiz@louiz.org>2018-03-17 17:34:00 +0100
commitf8a1048ffeec6322c1e64a0eda7636a977669898 (patch)
treee5e4f8055e73437318a36bddebd1c6d426fdce8e /src/xmpp
parentb956b9d1aa27ac71432839e286f3db0a19aebf6b (diff)
downloadbiboumi-f8a1048ffeec6322c1e64a0eda7636a977669898.tar.gz
biboumi-f8a1048ffeec6322c1e64a0eda7636a977669898.tar.bz2
biboumi-f8a1048ffeec6322c1e64a0eda7636a977669898.tar.xz
biboumi-f8a1048ffeec6322c1e64a0eda7636a977669898.zip
Re-apply "Use std::optional<bool> instead of OptionalBool"
This reverts commit 03714c6cebf90dc7db8e3997a18cdd19e039c667.
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/biboumi_adhoc_commands.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/xmpp/biboumi_adhoc_commands.cpp b/src/xmpp/biboumi_adhoc_commands.cpp
index 38b6165..53ec98b 100644
--- a/src/xmpp/biboumi_adhoc_commands.cpp
+++ b/src/xmpp/biboumi_adhoc_commands.cpp
@@ -493,7 +493,7 @@ void insert_irc_channel_configuration_form(XmlNode& node, const Jid& requester,
{
// Value selected by default
XmlSubNode value(record_history, "value");
- value.set_inner(options.col<Database::RecordHistoryOptional>().to_string());
+ value.set_inner(std::to_string(options.col<Database::RecordHistoryOptional>()));
}
// All three possible values
for (const auto& val: {"unset", "true", "false"})
@@ -594,19 +594,19 @@ bool handle_irc_channel_configuration_form(XmppComponent& xmpp_component, const
else if (field->get_tag("var") == "record_history" &&
value && !value->get_inner().empty())
{
- OptionalBool& database_value = options.col<Database::RecordHistoryOptional>();
+ std::optional<bool>& database_value = options.col<Database::RecordHistoryOptional>();
if (value->get_inner() == "true")
- database_value.set_value(true);
+ database_value = true;
else if (value->get_inner() == "false")
- database_value.set_value(false);
+ database_value = false;
else
- database_value.unset();
+ database_value.reset();
auto& biboumi_component = dynamic_cast<BiboumiComponent&>(xmpp_component);
Bridge* bridge = biboumi_component.find_user_bridge(requester.bare());
if (bridge)
{
- if (database_value.is_set)
- bridge->set_record_history(database_value.value);
+ if (database_value)
+ bridge->set_record_history(*database_value);
else
{ // It is unset, we need to fetch the Global option, to
// know if it’s enabled or not