From ba879a882e031d7b8503f78fe41d1210000c96ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Fri, 16 Mar 2018 00:53:47 +0100 Subject: Use std::optional instead of OptionalBool --- src/xmpp/biboumi_adhoc_commands.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/xmpp') 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().to_string()); + value.set_inner(std::to_string(options.col())); } // 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(); + std::optional& database_value = options.col(); 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(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 -- cgit v1.2.3