Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::AuthChannelHandler Class Reference

Manages channels for syncing informations. More...

#include <auth_channel_handler.h>

Inheritance diagram for jami::AuthChannelHandler:
Inheritance graph
Collaboration diagram for jami::AuthChannelHandler:
Collaboration graph

Public Member Functions

 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.
 
void connect (const dht::InfoHash &infoHash, const std::string &, ConnectCallbackLegacy &&cb) override
 
void onReady (const std::shared_ptr< dht::crypto::Certificate > &peer, const std::string &name, std::shared_ptr< dhtnet::ChannelSocket > channel) override
 Launch sync process.
 
bool onRequest (const std::shared_ptr< dht::crypto::Certificate > &peer, const std::string &name) override
 Determine if we accept or not the sync request.
 
 ~AuthChannelHandler ()
 
- Public Member Functions inherited from jami::ChannelHandlerInterface
virtual ~ChannelHandlerInterface ()
 

Detailed Description

Manages channels for syncing informations.

Definition at line 29 of file auth_channel_handler.h.

Constructor & Destructor Documentation

◆ AuthChannelHandler()

jami::AuthChannelHandler::AuthChannelHandler ( const std::shared_ptr< JamiAccount > &  acc,
dhtnet::ConnectionManager &  cm 
)

Definition at line 24 of file auth_channel_handler.cpp.

◆ ~AuthChannelHandler()

jami::AuthChannelHandler::~AuthChannelHandler ( )

Definition at line 31 of file auth_channel_handler.cpp.

Member Function Documentation

◆ connect() [1/2]

void jami::AuthChannelHandler::connect ( const DeviceId deviceId,
const std::string &  name,
ConnectCb &&  cb,
const std::string &  connectionType = "",
bool  forceNewConnection = false 
)
overridevirtual

Ask for a new sync channel.

Parameters
deviceIdThe device to connect
name(Unused, generated from deviceId)
cbThe callback to call when connected (can be immediate if already connected)

Implements jami::ChannelHandlerInterface.

Definition at line 35 of file auth_channel_handler.cpp.

References jami::emitSignal(), and JAMI_DEBUG.

Referenced by jami::ArchiveAccountManager::addDevice().

Here is the call graph for this function:

◆ connect() [2/2]

void jami::AuthChannelHandler::connect ( const dht::InfoHash &  infoHash,
const std::string &  channelPath,
ConnectCallbackLegacy &&  cb 
)
overridevirtual

Reimplemented from jami::ChannelHandlerInterface.

Definition at line 46 of file auth_channel_handler.cpp.

References jami::emitSignal(), and JAMI_DEBUG.

Here is the call graph for this function:

◆ onReady()

void jami::AuthChannelHandler::onReady ( const std::shared_ptr< dht::crypto::Certificate > &  peer,
const std::string &  name,
std::shared_ptr< dhtnet::ChannelSocket >  channel 
)
overridevirtual

Launch sync process.

Parameters
deviceIdDevice who asked
nameName asked
channelChannel used to sync

Implements jami::ChannelHandlerInterface.

Definition at line 72 of file auth_channel_handler.cpp.

References jami::emitSignal(), and JAMI_DEBUG.

Here is the call graph for this function:

◆ onRequest()

bool jami::AuthChannelHandler::onRequest ( const std::shared_ptr< dht::crypto::Certificate > &  peer,
const std::string &  name 
)
overridevirtual

Determine if we accept or not the sync request.

Parameters
deviceIdDevice who asked
nameName asked
Returns
if the channel is for a valid conversation and device not banned

Implements jami::ChannelHandlerInterface.

Definition at line 55 of file auth_channel_handler.cpp.

References jami::emitSignal(), and JAMI_DEBUG.

Here is the call graph for this function:

The documentation for this class was generated from the following files: