Create a common MessageModel and inherit SearchModel and MessageEventModel from it.

Title
This commit is contained in:
James Graham
2024-12-28 13:32:26 +00:00
parent 4f02472421
commit 6e4973cef7
23 changed files with 1049 additions and 1070 deletions

View File

@@ -64,7 +64,7 @@ public:
/**
* @brief Return a QDateTime object for the event timestamp.
*/
static QDateTime time(const Quotient::RoomEvent *event, bool isPending = false, QDateTime lastUpdated = {});
static QDateTime time(const NeoChatRoom *room, const Quotient::RoomEvent *event, bool isPending = false);
/**
* @brief Return a QString for the event timestamp.
@@ -80,11 +80,11 @@ public:
* @param lastUpdated the time the event was last updated locally as this cannot be
* obtained from the event.
*/
static QString timeString(const Quotient::RoomEvent *event,
static QString timeString(const NeoChatRoom *room,
const Quotient::RoomEvent *event,
bool relative,
QLocale::FormatType format = QLocale::ShortFormat,
bool isPending = false,
QDateTime lastUpdated = {});
bool isPending = false);
/**
* @brief Return a QString for the event timestamp.
@@ -98,7 +98,7 @@ public:
* @param lastUpdated the time the event was last updated locally as this cannot be
* obtained from the event.
*/
static QString timeString(const Quotient::RoomEvent *event, const QString &format, bool isPending = false, const QDateTime &lastUpdated = {});
static QString timeString(const NeoChatRoom *room, const Quotient::RoomEvent *event, const QString &format, bool isPending = false);
/**
* @brief Whether the event should be highlighted in the timeline.