qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
FriendMessageDispatcher Class Reference

#include <friendmessagedispatcher.h>

Inheritance diagram for FriendMessageDispatcher:
Inheritance graph
Collaboration diagram for FriendMessageDispatcher:
Collaboration graph

Public Member Functions

 FriendMessageDispatcher (Friend &f, MessageProcessor processor, ICoreFriendMessageSender &messageSender, ICoreExtPacketAllocator &coreExt)
 
std::pair< DispatchedMessageId, DispatchedMessageIdsendMessage (bool isAction, const QString &content) override
 
std::pair< DispatchedMessageId, DispatchedMessageIdsendExtendedMessage (const QString &content, ExtensionSet extensions) override
 
void onMessageReceived (bool isAction, const QString &content)
 Handles received message from toxcore. More...
 
void onReceiptReceived (ReceiptNum receipt)
 Handles received receipt from toxcore. More...
 
void onExtMessageReceived (const QString &message)
 
void onExtReceiptReceived (uint64_t receiptId)
 
void clearOutgoingMessages ()
 Clears all currently outgoing messages. More...
 
- Public Member Functions inherited from IMessageDispatcher
virtual ~IMessageDispatcher ()=default
 

Private Slots

void onFriendOnlineOfflineChanged (const ToxPk &key, bool isOnline)
 Handles status change for friend. More...
 

Private Member Functions

void sendProcessedMessage (Message const &msg, OfflineMsgEngine::CompletionFn fn)
 
void sendExtendedProcessedMessage (Message const &msg, OfflineMsgEngine::CompletionFn fn)
 
void sendCoreProcessedMessage (Message const &msg, OfflineMsgEngine::CompletionFn fn)
 
OfflineMsgEngine::CompletionFn getCompletionFn (DispatchedMessageId messageId)
 

Private Attributes

Friendf
 
ICoreExtPacketAllocatorcoreExtPacketAllocator
 
DispatchedMessageId nextMessageId = DispatchedMessageId(0)
 
ICoreFriendMessageSendermessageSender
 
OfflineMsgEngine offlineMsgEngine
 
MessageProcessor processor
 

Additional Inherited Members

- Signals inherited from IMessageDispatcher
void messageReceived (const ToxPk &sender, const Message &message)
 Emitted when a message is received and processed. More...
 
void messageSent (DispatchedMessageId id, const Message &message)
 Emitted when a message is processed and sent. More...
 
void messageComplete (DispatchedMessageId id)
 Emitted when a receiver report is received from the associated chat. More...
 
void messageBroken (DispatchedMessageId id, BrokenMessageReason reason)
 

Detailed Description

Definition at line 33 of file friendmessagedispatcher.h.

Constructor & Destructor Documentation

◆ FriendMessageDispatcher()

FriendMessageDispatcher::FriendMessageDispatcher ( Friend f,
MessageProcessor  processor,
ICoreFriendMessageSender messageSender,
ICoreExtPacketAllocator coreExt 
)

Definition at line 24 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ clearOutgoingMessages()

void FriendMessageDispatcher::clearOutgoingMessages ( )

Clears all currently outgoing messages.

Definition at line 123 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:

◆ getCompletionFn()

OfflineMsgEngine::CompletionFn FriendMessageDispatcher::getCompletionFn ( DispatchedMessageId  messageId)
private

Definition at line 190 of file friendmessagedispatcher.cpp.

Here is the caller graph for this function:

◆ onExtMessageReceived()

void FriendMessageDispatcher::onExtMessageReceived ( const QString &  message)

Definition at line 95 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:

◆ onExtReceiptReceived()

void FriendMessageDispatcher::onExtReceiptReceived ( uint64_t  receiptId)

Definition at line 101 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:

◆ onFriendOnlineOfflineChanged

void FriendMessageDispatcher::onFriendOnlineOfflineChanged ( const ToxPk key,
bool  isOnline 
)
privateslot

Handles status change for friend.

Note
Parameters just to fit slot api

Definition at line 110 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onMessageReceived()

void FriendMessageDispatcher::onMessageReceived ( bool  isAction,
const QString &  content 
)

Handles received message from toxcore.

Parameters
[in]isActionTrue if action message
[in]contentUnprocessed toxcore message

Definition at line 81 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:

◆ onReceiptReceived()

void FriendMessageDispatcher::onReceiptReceived ( ReceiptNum  receipt)

Handles received receipt from toxcore.

Parameters
[in]receiptreceipt id

Definition at line 90 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:

◆ sendCoreProcessedMessage()

void FriendMessageDispatcher::sendCoreProcessedMessage ( Message const &  msg,
OfflineMsgEngine::CompletionFn  fn 
)
private

Definition at line 172 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendExtendedMessage()

std::pair< DispatchedMessageId, DispatchedMessageId > FriendMessageDispatcher::sendExtendedMessage ( const QString &  content,
ExtensionSet  extensions 
)
overridevirtual
See also
IMessageDispatcher::sendExtendedMessage

Implements IMessageDispatcher.

Definition at line 59 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:

◆ sendExtendedProcessedMessage()

void FriendMessageDispatcher::sendExtendedProcessedMessage ( Message const &  msg,
OfflineMsgEngine::CompletionFn  fn 
)
private

Definition at line 145 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendMessage()

std::pair< DispatchedMessageId, DispatchedMessageId > FriendMessageDispatcher::sendMessage ( bool  isAction,
const QString &  content 
)
overridevirtual
See also
IMessageDispatcher::sendMessage

Implements IMessageDispatcher.

Definition at line 39 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:

◆ sendProcessedMessage()

void FriendMessageDispatcher::sendProcessedMessage ( Message const &  msg,
OfflineMsgEngine::CompletionFn  fn 
)
private

Definition at line 129 of file friendmessagedispatcher.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ coreExtPacketAllocator

ICoreExtPacketAllocator& FriendMessageDispatcher::coreExtPacketAllocator
private

Definition at line 60 of file friendmessagedispatcher.h.

◆ f

Friend& FriendMessageDispatcher::f
private

Definition at line 59 of file friendmessagedispatcher.h.

◆ messageSender

ICoreFriendMessageSender& FriendMessageDispatcher::messageSender
private

Definition at line 63 of file friendmessagedispatcher.h.

◆ nextMessageId

DispatchedMessageId FriendMessageDispatcher::nextMessageId = DispatchedMessageId(0)
private

Definition at line 61 of file friendmessagedispatcher.h.

◆ offlineMsgEngine

OfflineMsgEngine FriendMessageDispatcher::offlineMsgEngine
private

Definition at line 64 of file friendmessagedispatcher.h.

◆ processor

MessageProcessor FriendMessageDispatcher::processor
private

Definition at line 65 of file friendmessagedispatcher.h.


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