Time and date support in messageeventmodel && local echo support.

This commit is contained in:
Black Hat
2018-07-30 00:00:41 +08:00
parent a105f344f4
commit 93a303799a
7 changed files with 279 additions and 216 deletions

View File

@@ -14,6 +14,7 @@ class MessageEventModel : public QAbstractListModel {
EventTypeRole = Qt::UserRole + 1,
EventIdRole,
TimeRole,
AboveTimeRole,
SectionRole,
AboveSectionRole,
AuthorRole,
@@ -45,11 +46,13 @@ class MessageEventModel : public QAbstractListModel {
private:
QMatrixClient::Room* m_currentRoom = nullptr;
QString lastReadEventId;
bool mergingEcho = 0;
int nextNewerRow = -1;
QDateTime makeMessageTimestamp(QMatrixClient::Room::rev_iter_t baseIt) const;
QString makeDateString(QMatrixClient::Room::rev_iter_t baseIt) const;
void refreshEventRoles(const QString& eventId, const QVector<int> roles);
void refreshEventRoles(const int row, const QVector<int>& roles);
void refreshEventRoles(const QString& eventId, const QVector<int>& roles);
signals:
void roomChanged();