#include <sessionchatlog.h>
|
| SessionChatLog (const ICoreIdHandler &coreIdHandler) |
|
| SessionChatLog (ChatLogIdx initialIdx, const ICoreIdHandler &coreIdHandler) |
| Alternate constructor that allows for an initial index to be set. More...
|
|
| ~SessionChatLog () |
|
const ChatLogItem & | at (ChatLogIdx idx) const override |
| Returns reference to item at idx. More...
|
|
SearchResult | searchForward (SearchPos startIdx, const QString &phrase, const ParameterSearch ¶meter) const override |
| searches forwards through the chat log until phrase is found according to parameter More...
|
|
SearchResult | searchBackward (SearchPos startIdx, const QString &phrase, const ParameterSearch ¶meter) const override |
| searches backwards through the chat log until phrase is found according to parameter More...
|
|
ChatLogIdx | getFirstIdx () const override |
| The underlying chat log instance may not want to start at 0. More...
|
|
ChatLogIdx | getNextIdx () const override |
|
std::vector< DateChatLogIdxPair > | getDateIdxs (const QDate &startDate, size_t maxDates) const override |
| Gets indexes for each new date starting at startDate. More...
|
|
void | addSystemMessage (const SystemMessage &message) override |
| Inserts a system message at the end of the chat. More...
|
|
void | insertCompleteMessageAtIdx (ChatLogIdx idx, const ToxPk &sender, QString senderName, const ChatLogMessage &message) |
|
void | insertIncompleteMessageAtIdx (ChatLogIdx idx, const ToxPk &sender, QString senderName, const ChatLogMessage &message, DispatchedMessageId dispatchId) |
|
void | insertBrokenMessageAtIdx (ChatLogIdx idx, const ToxPk &sender, QString senderName, const ChatLogMessage &message) |
|
void | insertFileAtIdx (ChatLogIdx idx, const ToxPk &sender, QString senderName, const ChatLogFile &file) |
|
void | insertSystemMessageAtIdx (ChatLogIdx idx, SystemMessage message) |
|
virtual | ~IChatLog ()=default |
|
Definition at line 31 of file sessionchatlog.h.
◆ SessionChatLog() [1/2]
SessionChatLog::SessionChatLog |
( |
const ICoreIdHandler & |
coreIdHandler | ) |
|
◆ SessionChatLog() [2/2]
Alternate constructor that allows for an initial index to be set.
Definition at line 135 of file sessionchatlog.cpp.
◆ ~SessionChatLog()
SessionChatLog::~SessionChatLog |
( |
| ) |
|
|
default |
◆ addSystemMessage()
void SessionChatLog::addSystemMessage |
( |
const SystemMessage & |
message | ) |
|
|
overridevirtual |
Inserts a system message at the end of the chat.
- Parameters
-
[in] | message | systemMessage to insert |
Implements IChatLog.
Definition at line 322 of file sessionchatlog.cpp.
◆ at()
Returns reference to item at idx.
- Parameters
-
- Returns
- Variant type referencing either a ToxFile or Message
- Precondition
- idx must be between currentFirstIdx() and currentLastIdx()
Implements IChatLog.
Definition at line 150 of file sessionchatlog.cpp.
◆ getDateIdxs()
Gets indexes for each new date starting at startDate.
- Parameters
-
[in] | startDate | date to start searching from |
[in] | maxDates | maximum number of dates to be returned |
Implements IChatLog.
Definition at line 294 of file sessionchatlog.cpp.
◆ getFirstIdx()
The underlying chat log instance may not want to start at 0.
- Returns
- Current first valid index to call at() with
Implements IChatLog.
Definition at line 280 of file sessionchatlog.cpp.
◆ getNextIdx()
◆ insertBrokenMessageAtIdx()
◆ insertCompleteMessageAtIdx()
◆ insertFileAtIdx()
◆ insertIncompleteMessageAtIdx()
◆ insertSystemMessageAtIdx()
◆ onFileTransferBrokenUnbroken
void SessionChatLog::onFileTransferBrokenUnbroken |
( |
const ToxPk & |
sender, |
|
|
const ToxFile & |
file, |
|
|
bool |
broken |
|
) |
| |
|
slot |
◆ onFileTransferRemotePausedUnpaused
void SessionChatLog::onFileTransferRemotePausedUnpaused |
( |
const ToxPk & |
sender, |
|
|
const ToxFile & |
file, |
|
|
bool |
paused |
|
) |
| |
|
slot |
◆ onFileUpdated
void SessionChatLog::onFileUpdated |
( |
const ToxPk & |
sender, |
|
|
const ToxFile & |
file |
|
) |
| |
|
slot |
Updates file state in the chatlog.
- Note
- The files need to be pre-filtered for the current chat since we do no validation
-
This should be attached to any CoreFile signal that fits the signature
Definition at line 467 of file sessionchatlog.cpp.
◆ onMessageBroken
◆ onMessageComplete
◆ onMessageReceived
void SessionChatLog::onMessageReceived |
( |
const ToxPk & |
sender, |
|
|
const Message & |
message |
|
) |
| |
|
slot |
◆ onMessageSent
◆ resolveSenderNameFromSender()
QString SessionChatLog::resolveSenderNameFromSender |
( |
const ToxPk & |
sender | ) |
|
|
private |
◆ searchBackward()
searches backwards through the chat log until phrase is found according to parameter
- Parameters
-
[in] | startIdx | inclusive start idx |
[in] | phrase | phrase to find (may be modified by parameter) |
[in] | parameter | search parameters |
Implements IChatLog.
Definition at line 213 of file sessionchatlog.cpp.
◆ searchForward()
searches forwards through the chat log until phrase is found according to parameter
- Parameters
-
[in] | startIdx | inclusive start idx |
[in] | phrase | phrase to find (may be modified by parameter) |
[in] | parameter | search parameters |
Implements IChatLog.
Definition at line 160 of file sessionchatlog.cpp.
◆ coreIdHandler
◆ currentFileTransfers
Short list of active file transfers in given log. This is to make it so we don't have to search through all files that have ever been transferred in order to find our existing transfers
Definition at line 91 of file sessionchatlog.h.
◆ items
◆ nextIdx
◆ outgoingMessages
Maps DispatchedMessageIds back to ChatLogIdxs. Messages are removed when the message is marked as completed
Definition at line 97 of file sessionchatlog.h.
The documentation for this class was generated from the following files: