20#include <opendht/thread_pool.h>
25 dhtnet::ConnectionManager&
cm)
28 , connectionManager_(
cm)
36 const std::string& name,
41 JAMI_DEBUG(
"[AuthChannel {}] connecting to name = {}", deviceId.toString(), name);
42 connectionManager_.connectDevice(deviceId, name, std::move(
cb));
56 const std::string& name)
58 JAMI_DEBUG(
"[AuthChannel] New auth channel requested for `{}`.",
cert->getId().toString());
59 auto acc = account_.lock();
63 JAMI_DEBUG(
"[AuthChannel] New auth channel requested with name = `{}`.", name);
65 if (
auto acc = account_.lock())
73 const std::string& deviceId,
74 std::shared_ptr<dhtnet::ChannelSocket> channel)
76 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