26 lines
651 B
C++
26 lines
651 B
C++
// SPDX-FileCopyrightText: 2024 Yury Gubich <blue@macaw.me>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
#include "gloox/client.h"
|
|
#include "gloox/connectionlistener.h"
|
|
|
|
#include "component/config.h"
|
|
|
|
class Connection : public gloox::ConnectionListener {
|
|
public:
|
|
Connection(const std::shared_ptr<Config>& config, const std::shared_ptr<gloox::Client>& client);
|
|
~Connection();
|
|
|
|
void onConnect() override;
|
|
void onDisconnect(gloox::ConnectionError e) override;
|
|
bool onTLSConnect(const gloox::CertInfo&) override;
|
|
|
|
private:
|
|
std::weak_ptr<Config> config;
|
|
std::weak_ptr<gloox::Client> client;
|
|
};
|