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

#include <message_engine.h>

Collaboration diagram for jami::im::MessageEngine:
Collaboration graph

Public Member Functions

MessageStatus getStatus (MessageToken t) const
 
void load ()
 Load persisted messages.
 
 MessageEngine (SIPAccountBase &, const std::filesystem::path &path)
 
void onMessageSent (const std::string &peer, MessageToken t, bool success, const std::string &deviceId={})
 
void onPeerOnline (const std::string &peer, const std::string &deviceId={}, bool retryOnTimeout=true)
 @TODO change MessageEngine by a queue, @NOTE retryOnTimeout is used for failing SIP messages (jamiAccount::sendTextMessage)
 
void save () const
 Persist messages.
 
MessageToken sendMessage (const std::string &to, const std::string &deviceId, const std::map< std::string, std::string > &payloads, uint64_t refreshToken)
 Add a message to the engine and try to send it.
 

Detailed Description

Definition at line 40 of file message_engine.h.

Constructor & Destructor Documentation

◆ MessageEngine()

jami::im::MessageEngine::MessageEngine ( SIPAccountBase acc,
const std::filesystem::path &  path 
)

Definition at line 34 of file message_engine.cpp.

Member Function Documentation

◆ getStatus()

MessageStatus jami::im::MessageEngine::getStatus ( MessageToken  t) const

Definition at line 128 of file message_engine.cpp.

References jami::emitSignal(), and jami::im::UNKNOWN.

Referenced by jami::SIPAccountBase::getMessageStatus().

Here is the call graph for this function:

◆ load()

void jami::im::MessageEngine::load ( )

Load persisted messages.

Definition at line 200 of file message_engine.cpp.

References jami::emitSignal(), jami::Account::getAccountID(), and JAMI_LOG.

Referenced by jami::SIPAccountBase::setRegistrationState().

Here is the call graph for this function:

◆ onMessageSent()

void jami::im::MessageEngine::onMessageSent ( const std::string &  peer,
MessageToken  t,
bool  success,
const std::string &  deviceId = {} 
)

◆ onPeerOnline()

void jami::im::MessageEngine::onPeerOnline ( const std::string &  peer,
const std::string &  deviceId = {},
bool  retryOnTimeout = true 
)

@TODO change MessageEngine by a queue, @NOTE retryOnTimeout is used for failing SIP messages (jamiAccount::sendTextMessage)

Definition at line 79 of file message_engine.cpp.

References jami::emitSignal().

Here is the call graph for this function:

◆ save()

void jami::im::MessageEngine::save ( ) const

Persist messages.

Definition at line 240 of file message_engine.cpp.

Referenced by jami::SIPAccountBase::setRegistrationState().

◆ sendMessage()

MessageToken jami::im::MessageEngine::sendMessage ( const std::string &  to,
const std::string &  deviceId,
const std::map< std::string, std::string > &  payloads,
uint64_t  refreshToken 
)

Add a message to the engine and try to send it.

Parameters
toUri of the peer
deviceId(Optional) if we want to send to a specific device
payloadsThe message
refreshTokenThe token of the message

Definition at line 44 of file message_engine.cpp.

References jami::emitSignal(), jami::im::IDLE, jami::JAMI_ID_MAX_VAL, and jami::Account::rand.

Referenced by jami::SIPAccountBase::sendTextMessage().

Here is the call graph for this function:

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