mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Create function for processing whether a message is a reply
This commit is contained in:
parent
d8fb4d9292
commit
39576fea96
3 changed files with 11 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "Cache.h"
|
#include "Cache.h"
|
||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
|
#include "EventAccessors.h"
|
||||||
#include "MatrixClient.h"
|
#include "MatrixClient.h"
|
||||||
#include "UserSettingsPage.h"
|
#include "UserSettingsPage.h"
|
||||||
|
|
||||||
|
@ -696,3 +697,9 @@ utils::readImage(const QByteArray *data)
|
||||||
reader.setAutoTransform(true);
|
reader.setAutoTransform(true);
|
||||||
return reader.read();
|
return reader.read();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
utils::isReply(const mtx::events::collections::TimelineEvents &e)
|
||||||
|
{
|
||||||
|
return mtx::accessors::relations(e).reply_to().has_value();
|
||||||
|
}
|
||||||
|
|
|
@ -310,4 +310,7 @@ restoreCombobox(QComboBox *combo, const QString &value);
|
||||||
//! Read image respecting exif orientation
|
//! Read image respecting exif orientation
|
||||||
QImage
|
QImage
|
||||||
readImage(const QByteArray *data);
|
readImage(const QByteArray *data);
|
||||||
|
|
||||||
|
bool
|
||||||
|
isReply(const mtx::events::collections::TimelineEvents &e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,7 +369,7 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r
|
||||||
|
|
||||||
auto ascent = QFontMetrics(UserSettings::instance()->font()).ascent();
|
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));
|
auto formattedBody_ = QString::fromStdString(formatted_body(event));
|
||||||
if (formattedBody_.isEmpty()) {
|
if (formattedBody_.isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue