// SPDX-FileCopyrightText: 2024 Yury Gubich <blue@macaw.me>
// SPDX-License-Identifier: GPL-3.0-or-later

#include "connection.h"

Connection::Connection(const std::shared_ptr<Config>& config, const std::shared_ptr<gloox::Client>& client):
    config(config),
    client(client)
{
    client->registerConnectionListener(this);
}

Connection::~Connection() {
    if (std::shared_ptr<gloox::Client> cl = client.lock())
        cl->removeConnectionListener(this);
}


void Connection::onConnect() {}

void Connection::onDisconnect(gloox::ConnectionError e) {}

bool Connection::onTLSConnect(const gloox::CertInfo& info) {
    return true;
}