diff --git a/src/Utils.cpp b/src/Utils.cpp index 5c03c52f..40c16fd3 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp @@ -24,6 +24,7 @@ #include "Cache.h" #include "Config.h" +#include "EventAccessors.h" #include "MatrixClient.h" #include "UserSettingsPage.h" @@ -696,3 +697,9 @@ utils::readImage(const QByteArray *data) reader.setAutoTransform(true); return reader.read(); } + +bool +utils::isReply(const mtx::events::collections::TimelineEvents &e) +{ + return mtx::accessors::relations(e).reply_to().has_value(); +} diff --git a/src/Utils.h b/src/Utils.h index 373bed01..1dc5ffd6 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -310,4 +310,7 @@ restoreCombobox(QComboBox *combo, const QString &value); //! Read image respecting exif orientation QImage readImage(const QByteArray *data); + +bool +isReply(const mtx::events::collections::TimelineEvents &e); } diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 004cf26a..cfca626a 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -369,7 +369,7 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r auto ascent = QFontMetrics(UserSettings::instance()->font()).ascent(); - bool isReply = relations(event).reply_to().has_value(); + bool isReply = utils::isReply(event); auto formattedBody_ = QString::fromStdString(formatted_body(event)); if (formattedBody_.isEmpty()) {