qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
Go to the documentation of this file.
29 #include <tox/toxencryptsave.h>
53 :
data(std::make_shared<QString>(std::move(
message)))
75 return *
static_cast<QString*
>(
data.get());
93 return *
static_cast<QString*
>(
data.get());
135 class History :
public QObject,
public std::enable_shared_from_this<History>
169 ,
content(std::move(systemMessage))
189 explicit History(std::shared_ptr<RawDatabase>
db);
199 const QDateTime& time,
bool isDelivered,
ExtensionSet extensions,
200 QString dispName,
const std::function<
void(
RowId)>& insertIdCallback = {});
203 const QString& fileName,
const QString& filePath, int64_t size,
204 const ToxPk& sender,
const QDateTime& time, QString
const& dispName);
208 void setFileFinished(
const QString& fileId,
bool success,
const QString& filePath,
const QByteArray& fileHash);
216 const QDate& from,
size_t maxNum);
228 QVector<RawDatabase::Query>
233 const QString& filePath,
const QByteArray& fileHash);
237 std::shared_ptr<RawDatabase>
db;
void fileInserted(RowId dbId, QString fileId)
void setFileFinished(const QString &fileId, bool success, const QString &filePath, const QByteArray &fileHash)
bool isValid()
Checks if the database was opened successfully.
Q_DECLARE_METATYPE(ExtendedReceiptNum)
HistMessageContent(SystemMessage systemMessage)
Handles all qTox internal paths.
HistMessageContent(ToxFile file)
void markAsBroken(RowId messageId, BrokenMessageReason reason)
HistMessage(RowId id, QDateTime timestamp, QString chat, SystemMessage systemMessage)
static RawDatabase::Query generateFileFinished(RowId fileId, bool success, const QString &filePath, const QByteArray &fileHash)
NamedType< int64_t, struct RowIdTag, Orderable > RowId
void eraseHistory()
Erases all the chat history from the database.
const QString & asMessage() const
void removeFriendHistory(const ToxPk &friendPk)
Erases the chat history with one friend.
HistMessage(RowId id, MessageState state, ExtensionSet extensionSet, QDateTime timestamp, QString chat, QString dispName, QString sender, QString message)
bool historyExists(const ToxPk &friendPk)
Checks if a friend has chat history.
HistMessageContentType getType() const
ExtensionSet extensionSet
bool historyAccessBlocked()
Determines if history access should be blocked.
void addNewSystemMessage(const ToxPk &friendPk, const SystemMessage &systemMessage)
void markAsDelivered(RowId messageId)
Marks a message as delivered. Removing message from the faux-offline pending messages list.
std::shared_ptr< RawDatabase > db
void onFileInserted(RowId dbId, QString fileId)
HistMessageContent(QString message)
size_t getNumMessagesForFriendBeforeDate(const ToxPk &friendPk, const QDateTime &date)
QList< HistMessage > getUndeliveredMessagesForFriend(const ToxPk &friendPk)
const SystemMessage & asSystemMessage() const
This class represents a Tox Public Key, which is a part of Tox ID.
QList< DateIdx > getNumMessagesForFriendBeforeDateBoundaries(const ToxPk &friendPk, const QDate &from, size_t maxNum)
Gets date boundaries in conversation with friendPk. History doesn't model conversation indexes,...
HistMessageContentType type
QList< HistMessage > getMessagesForFriend(const ToxPk &friendPk, size_t firstIdx, size_t lastIdx)
HistMessage(RowId id, MessageState state, QDateTime timestamp, QString chat, QString dispName, QString sender, ToxFile file)
History(std::shared_ptr< RawDatabase > db)
Prepares the database to work with the history.
std::bitset< ExtensionType::max > ExtensionSet
Interacts with the profile database to save the chat history.
QHash< QString, FileInfo > fileInfos
void addNewFileMessage(const ToxPk &friendPk, const QString &fileId, const QString &fileName, const QString &filePath, int64_t size, const ToxPk &sender, const QDateTime &time, QString const &dispName)
size_t getNumMessagesForFriend(const ToxPk &friendPk)
HistMessageContent content
void addNewMessage(const ToxPk &friendPk, const QString &message, const ToxPk &sender, const QDateTime &time, bool isDelivered, ExtensionSet extensions, QString dispName, const std::function< void(RowId)> &insertIdCallback={})
Saves a chat message in the database.
std::shared_ptr< void > data
SystemMessage & asSystemMessage()
QDateTime getDateWhereFindPhrase(const ToxPk &friendPk, const QDateTime &from, QString phrase, const ParameterSearch ¶meter)
Search phrase in chat messages.
const ToxFile & asFile() const
QVector< RawDatabase::Query > generateNewFileTransferQueries(const ToxPk &friendPk, const ToxPk &sender, const QDateTime &time, const QString &dispName, const FileDbInsertionData &insertionData)
int64_t getPeerId(ToxPk const &pk)