#include <chathistory.h>
Definition at line 31 of file chathistory.h.
◆ ChatHistory()
◆ addSystemMessage()
void ChatHistory::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 209 of file chathistory.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 113 of file chathistory.cpp.
◆ breakMessage()
◆ canUseHistory()
bool ChatHistory::canUseHistory |
( |
| ) |
const |
|
private |
◆ completeMessage()
◆ dispatchUnsentMessages()
Sends any unsent messages in history to the underlying message dispatcher.
- Parameters
-
Definition at line 426 of file chathistory.cpp.
◆ ensureIdxInSessionChatLog()
void ChatHistory::ensureIdxInSessionChatLog |
( |
ChatLogIdx |
idx | ) |
const |
|
private |
Forces the given index and all future indexes to be in the chatlog.
- Parameters
-
- Note
- Marked const since this doesn't change external state of the class. We still have all the same items at all the same indexes, we've just stuckem in ram
Definition at line 328 of file chathistory.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 186 of file chathistory.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 172 of file chathistory.cpp.
◆ getInitialChatLogIdx()
ChatLogIdx ChatHistory::getInitialChatLogIdx |
( |
| ) |
const |
|
private |
Gets the initial chat log index for a sessionChatLog with 0 items loaded from history. Needed to keep history indexes in sync with chat log indexes.
- Parameters
-
- Returns
- Initial chat log index
Definition at line 521 of file chathistory.cpp.
◆ getNextIdx()
◆ handleDispatchedMessage()
◆ loadHistoryIntoSessionChatLog()
void ChatHistory::loadHistoryIntoSessionChatLog |
( |
ChatLogIdx |
start | ) |
const |
|
private |
Unconditionally loads the given index and all future messages that are not in the session chat log into the session chat log.
- Parameters
-
- Note
- Marked const since this doesn't change external state of the class. We still have all the same items at all the same indexes, we've just stuckem in ram
-
no end idx as we always load from start -> latest. In the future we could have a less contiguous history
Definition at line 344 of file chathistory.cpp.
◆ onFileTransferBrokenUnbroken
void ChatHistory::onFileTransferBrokenUnbroken |
( |
const ToxPk & |
sender, |
|
|
const ToxFile & |
file, |
|
|
bool |
broken |
|
) |
| |
|
slot |
◆ onFileTransferRemotePausedUnpaused
void ChatHistory::onFileTransferRemotePausedUnpaused |
( |
const ToxPk & |
sender, |
|
|
const ToxFile & |
file, |
|
|
bool |
paused |
|
) |
| |
|
slot |
◆ onFileUpdated
void ChatHistory::onFileUpdated |
( |
const ToxPk & |
sender, |
|
|
const ToxFile & |
file |
|
) |
| |
|
slot |
◆ onMessageBroken
◆ onMessageComplete
◆ onMessageReceived
void ChatHistory::onMessageReceived |
( |
const ToxPk & |
sender, |
|
|
const Message & |
message |
|
) |
| |
|
privateslot |
◆ onMessageSent
◆ 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 138 of file chathistory.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 122 of file chathistory.cpp.
◆ brokenMessages
◆ completedMessages
◆ coreIdHandler
◆ dispatchedMessageRowIdMap
◆ history
◆ sessionChatLog
◆ settings
The documentation for this class was generated from the following files: