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

#include <groupmessagedispatcher.h>

Inheritance diagram for GroupMessageDispatcher:
Inheritance graph
Collaboration diagram for GroupMessageDispatcher:
Collaboration graph

Public Member Functions

 GroupMessageDispatcher (Group &group, MessageProcessor processor, ICoreIdHandler &idHandler, ICoreGroupMessageSender &messageSender, const IGroupSettings &groupSettings)
 
std::pair< DispatchedMessageId, DispatchedMessageIdsendMessage (bool isAction, QString const &content) override
 Sends message to associated chat. More...
 
std::pair< DispatchedMessageId, DispatchedMessageIdsendExtendedMessage (const QString &content, ExtensionSet extensions) override
 Sends message to associated chat ensuring that extensions are available. More...
 
void onMessageReceived (ToxPk const &sender, bool isAction, QString const &content)
 Processes and dispatches received message from toxcore. More...
 
- Public Member Functions inherited from IMessageDispatcher
virtual ~IMessageDispatcher ()=default
 

Private Attributes

Groupgroup
 
MessageProcessor processor
 
ICoreIdHandleridHandler
 
ICoreGroupMessageSendermessageSender
 
const IGroupSettingsgroupSettings
 
DispatchedMessageId nextMessageId {0}
 

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 35 of file groupmessagedispatcher.h.

Constructor & Destructor Documentation

◆ GroupMessageDispatcher()

GroupMessageDispatcher::GroupMessageDispatcher ( Group group,
MessageProcessor  processor,
ICoreIdHandler idHandler,
ICoreGroupMessageSender messageSender,
const IGroupSettings groupSettings 
)

Definition at line 25 of file groupmessagedispatcher.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ onMessageReceived()

void GroupMessageDispatcher::onMessageReceived ( ToxPk const &  sender,
bool  isAction,
QString const &  content 
)

Processes and dispatches received message from toxcore.

Parameters
[in]sender
[in]isActionTrue if is action
[in]contentMessage content

Definition at line 85 of file groupmessagedispatcher.cpp.

Here is the call graph for this function:

◆ sendExtendedMessage()

std::pair< DispatchedMessageId, DispatchedMessageId > GroupMessageDispatcher::sendExtendedMessage ( const QString &  content,
ExtensionSet  extensions 
)
overridevirtual

Sends message to associated chat ensuring that extensions are available.

Parameters
[in]contentMessage content
[in]extensionsextensions required for given message
Returns
Pair of first and last dispatched message IDs
Note
If the provided extensions are not supported the message will be flagged as broken

Implements IMessageDispatcher.

Definition at line 69 of file groupmessagedispatcher.cpp.

Here is the call graph for this function:

◆ sendMessage()

std::pair< DispatchedMessageId, DispatchedMessageId > GroupMessageDispatcher::sendMessage ( bool  isAction,
QString const &  content 
)
overridevirtual

Sends message to associated chat.

Parameters
[in]isActionTrue if is action message
[in]contentMessage content
Returns
Pair of first and last dispatched message IDs

Implements IMessageDispatcher.

Definition at line 39 of file groupmessagedispatcher.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ group

Group& GroupMessageDispatcher::group
private

Definition at line 51 of file groupmessagedispatcher.h.

◆ groupSettings

const IGroupSettings& GroupMessageDispatcher::groupSettings
private

Definition at line 55 of file groupmessagedispatcher.h.

◆ idHandler

ICoreIdHandler& GroupMessageDispatcher::idHandler
private

Definition at line 53 of file groupmessagedispatcher.h.

◆ messageSender

ICoreGroupMessageSender& GroupMessageDispatcher::messageSender
private

Definition at line 54 of file groupmessagedispatcher.h.

◆ nextMessageId

DispatchedMessageId GroupMessageDispatcher::nextMessageId {0}
private

Definition at line 56 of file groupmessagedispatcher.h.

◆ processor

MessageProcessor GroupMessageDispatcher::processor
private

Definition at line 52 of file groupmessagedispatcher.h.


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