make a myirc namespace
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
add_executable(xbot
|
||||
main.cpp
|
||||
settings.cpp
|
||||
web.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(xbot PRIVATE
|
||||
myirc
|
||||
OpenSSL::SSL
|
||||
Boost::signals2 Boost::log Boost::asio
|
||||
Boost::signals2 Boost::log Boost::asio Boost::beast
|
||||
tomlplusplus_tomlplusplus
|
||||
PkgConfig::LIBHS
|
||||
mysocks5 mybase64)
|
||||
|
@@ -1,13 +1,16 @@
|
||||
#include "bot.hpp"
|
||||
#include "challenge.hpp"
|
||||
#include "client.hpp"
|
||||
#include "connection.hpp"
|
||||
#include "openssl_utils.hpp"
|
||||
#include "registration.hpp"
|
||||
#include "sasl_mechanism.hpp"
|
||||
#include "settings.hpp"
|
||||
#include "ref.hpp"
|
||||
#include "irc_coroutine.hpp"
|
||||
#include "web.hpp"
|
||||
|
||||
#include "myirc/bot.hpp"
|
||||
#include "myirc/challenge.hpp"
|
||||
#include "myirc/client.hpp"
|
||||
#include "myirc/connection.hpp"
|
||||
#include "myirc/openssl_utils.hpp"
|
||||
#include "myirc/registration.hpp"
|
||||
#include "myirc/sasl_mechanism.hpp"
|
||||
#include "myirc/ref.hpp"
|
||||
#include "myirc/irc_coroutine.hpp"
|
||||
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
@@ -19,6 +22,16 @@
|
||||
#include <memory>
|
||||
|
||||
using namespace std::literals;
|
||||
using myirc::SaslMechanism;
|
||||
using myirc::SaslPlain;
|
||||
using myirc::SaslExternal;
|
||||
using myirc::SaslEcdsa;
|
||||
using myirc::Bot;
|
||||
using myirc::Client;
|
||||
using myirc::Connection;
|
||||
using myirc::Registration;
|
||||
using myirc::Challenge;
|
||||
using myirc::Ref;
|
||||
|
||||
auto configure_sasl(const Settings &settings) -> std::unique_ptr<SaslMechanism>
|
||||
{
|
||||
@@ -38,7 +51,7 @@ auto configure_sasl(const Settings &settings) -> std::unique_ptr<SaslMechanism>
|
||||
not settings.sasl_authcid.empty() &&
|
||||
not settings.sasl_key_file.empty()
|
||||
) {
|
||||
if (auto sasl_key = key_from_file(settings.sasl_key_file, settings.sasl_key_password))
|
||||
if (auto sasl_key = myirc::key_from_file(settings.sasl_key_file, settings.sasl_key_password))
|
||||
return std::make_unique<SaslEcdsa>(
|
||||
settings.sasl_authcid,
|
||||
settings.sasl_authzid,
|
||||
@@ -52,13 +65,13 @@ static auto start(boost::asio::io_context &io, const Settings &settings) -> void
|
||||
Ref<X509> tls_cert;
|
||||
if (settings.use_tls && not settings.tls_cert_file.empty())
|
||||
{
|
||||
tls_cert = cert_from_file(settings.tls_cert_file);
|
||||
tls_cert = myirc::cert_from_file(settings.tls_cert_file);
|
||||
}
|
||||
|
||||
Ref<EVP_PKEY> tls_key;
|
||||
if (settings.use_tls && not settings.tls_key_file.empty())
|
||||
{
|
||||
tls_key = key_from_file(settings.tls_key_file, settings.tls_key_password);
|
||||
tls_key = myirc::key_from_file(settings.tls_key_file, settings.tls_key_password);
|
||||
}
|
||||
|
||||
const auto connection = std::make_shared<Connection>(io);
|
||||
@@ -75,7 +88,7 @@ static auto start(boost::asio::io_context &io, const Settings &settings) -> void
|
||||
|
||||
// Configure CHALLENGE on registration if applicable
|
||||
if (not settings.challenge_username.empty() && not settings.challenge_key_file.empty()) {
|
||||
if (auto key = key_from_file(settings.challenge_key_file, settings.challenge_key_password)) {
|
||||
if (auto key = myirc::key_from_file(settings.challenge_key_file, settings.challenge_key_password)) {
|
||||
client->sig_registered.connect([&settings, connection, key = std::move(key)]() {
|
||||
Challenge::start(connection, settings.challenge_username, key);
|
||||
});
|
||||
|
1
driver/web.cpp
Normal file
1
driver/web.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "web.hpp"
|
1
driver/web.hpp
Normal file
1
driver/web.hpp
Normal file
@@ -0,0 +1 @@
|
||||
#pragma once
|
Reference in New Issue
Block a user