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

Manages channels for syncing information between devices of the same account. More...

#include <sync_channel_handler.h>

Inheritance diagram for jami::SyncChannelHandler:
Inheritance graph
Collaboration diagram for jami::SyncChannelHandler:
Collaboration graph

Public Member Functions

void connect (const DeviceId &deviceId, const std::string &, ConnectCb &&cb, const std::string &connectionType="", bool forceNewConnection=false) override
 Ask for a new sync channel.
 
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.
 
 SyncChannelHandler (const std::shared_ptr< JamiAccount > &acc, dhtnet::ConnectionManager &cm)
 
 ~SyncChannelHandler ()
 
- Public Member Functions inherited from jami::ChannelHandlerInterface
virtual void connect (const dht::InfoHash &, const std::string &, ConnectCallbackLegacy &&)
 
virtual ~ChannelHandlerInterface ()
 

Detailed Description

Manages channels for syncing information between devices of the same account.

Definition at line 28 of file sync_channel_handler.h.

Constructor & Destructor Documentation

◆ SyncChannelHandler()

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

Definition at line 24 of file sync_channel_handler.cpp.

◆ ~SyncChannelHandler()

jami::SyncChannelHandler::~SyncChannelHandler ( )

Definition at line 31 of file sync_channel_handler.cpp.

Member Function Documentation

◆ connect()

void jami::SyncChannelHandler::connect ( const DeviceId deviceId,
const std::string &  ,
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)
connectionTypeThe connection type used by iOS notifications (not used)
forceNewConnectionIf we want a new SIP connection (not used)

Implements jami::ChannelHandlerInterface.

Definition at line 34 of file sync_channel_handler.cpp.

References jami::emitSignal(), JAMI_LOG, and SYNC_SCHEME.

Here is the call graph for this function:

◆ onReady()

void jami::SyncChannelHandler::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 59 of file sync_channel_handler.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ onRequest()

bool jami::SyncChannelHandler::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 49 of file sync_channel_handler.cpp.

References jami::emitSignal().

Here is the call graph for this function:

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