20#include <opendht/thread_pool.h>
27 , connectionManager_(
cm)
35 const std::string& name,
40 JAMI_DEBUG(
"[AuthChannel {}] connecting to name = {}", deviceId.toString(), name);
41 connectionManager_.connectDevice(deviceId, name, std::move(
cb));
54 JAMI_DEBUG(
"[AuthChannel] New auth channel requested for `{}`.",
cert->getId().toString());
55 auto acc = account_.lock();
59 JAMI_DEBUG(
"[AuthChannel] New auth channel requested with name = `{}`.", name);
61 if (
auto acc = account_.lock())
69 const std::string& deviceId,
70 std::shared_ptr<dhtnet::ChannelSocket> )
72 JAMI_DEBUG(
"[AuthChannel] Auth channel with {}/{} ready.",
cert->getId().toString(), deviceId);
AuthChannelHandler(const std::shared_ptr< JamiAccount > &acc, dhtnet::ConnectionManager &cm)
void connect(const DeviceId &deviceId, const std::string &name, ConnectCb &&cb, const std::string &connectionType="", bool forceNewConnection=false) override
Ask for a new sync channel.
bool onRequest(const std::shared_ptr< dht::crypto::Certificate > &peer, const std::string &name) override
Determine if we accept or not the sync request.
void onReady(const std::shared_ptr< dht::crypto::Certificate > &peer, const std::string &name, std::shared_ptr< dhtnet::ChannelSocket > channel) override
Launch sync process.
A Channel handler is used to make the link between JamiAccount and ConnectionManager Its role is to m...
#define JAMI_DEBUG(formatstr,...)
std::function< void(std::shared_ptr< dhtnet::ChannelSocket >, const DeviceId &)> ConnectCb
void emitSignal(Args... args)
std::function< void(std::shared_ptr< dhtnet::ChannelSocket >, const dht::InfoHash &)> ConnectCallbackLegacy