From 2df0ebf2dfed1dcbf80c92bff8361e2a04581bec Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 25 Feb 2015 18:35:30 +0100 Subject: Add support for a fixed_irc_server configuration This option lets the administrator choose a specific IRC server, and only that server can be used with this biboumi instance. In this mode, JIDs to use are changed like this: - #chan%irc.example.com@biboumi.example.com -> #chan@biboumi.example.com - user!irc.example.com@biboumi.example.com -> user!@biboumi.example.com - #chan%irc.example.com@biboumi.example.com/Nick -> #chan@biboumi.example.com/Nick - %irc.example.com@biboumi.example.com -> no equivalent - irc.example.com@biboumi.example.com -> no equivalent --- src/utils/empty_if_fixed_server.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/utils/empty_if_fixed_server.hpp (limited to 'src/utils/empty_if_fixed_server.hpp') diff --git a/src/utils/empty_if_fixed_server.hpp b/src/utils/empty_if_fixed_server.hpp new file mode 100644 index 0000000..8739fd9 --- /dev/null +++ b/src/utils/empty_if_fixed_server.hpp @@ -0,0 +1,26 @@ +#ifndef EMPTY_IF_FIXED_SERVER_HPP_INCLUDED +#define EMPTY_IF_FIXED_SERVER_HPP_INCLUDED + +#include + +#include + +namespace utils +{ + inline std::string empty_if_fixed_server(std::string&& str) + { + if (!Config::get("fixed_irc_server", "").empty()) + return {}; + return str; + } + + inline std::string empty_if_fixed_server(const std::string& str) + { + if (!Config::get("fixed_irc_server", "").empty()) + return {}; + return str; + } + +} + +#endif /* EMPTY_IF_FIXED_SERVER_HPP_INCLUDED */ -- cgit v1.2.3 From 81f8f45b371d1a0ef72c2768fbd1f9188fe83616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 4 Jul 2016 17:53:53 +0200 Subject: Replace all include guards by #pragma once MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s $CURRENT_YEAR --- src/utils/empty_if_fixed_server.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/utils/empty_if_fixed_server.hpp') diff --git a/src/utils/empty_if_fixed_server.hpp b/src/utils/empty_if_fixed_server.hpp index 8739fd9..9ccf5fd 100644 --- a/src/utils/empty_if_fixed_server.hpp +++ b/src/utils/empty_if_fixed_server.hpp @@ -1,5 +1,5 @@ -#ifndef EMPTY_IF_FIXED_SERVER_HPP_INCLUDED -#define EMPTY_IF_FIXED_SERVER_HPP_INCLUDED +#pragma once + #include @@ -23,4 +23,4 @@ namespace utils } -#endif /* EMPTY_IF_FIXED_SERVER_HPP_INCLUDED */ + -- cgit v1.2.3