Run linter
This commit is contained in:
parent
049613211a
commit
7b2f7e65fd
@ -413,17 +413,19 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, const QString &room_i
|
|||||||
|
|
||||||
// When a message is sent, check if the current edit/reply relates to that message,
|
// When a message is sent, check if the current edit/reply relates to that message,
|
||||||
// and update the event_id so that it points to the sent message and not the pending one.
|
// and update the event_id so that it points to the sent message and not the pending one.
|
||||||
connect(
|
connect(&events,
|
||||||
&events, &EventStore::messageSent, this, [this](const std::string &txn_id, const std::string &event_id) {
|
&EventStore::messageSent,
|
||||||
if (edit_.toStdString() == txn_id) {
|
this,
|
||||||
edit_ = QString::fromStdString(event_id);
|
[this](const std::string &txn_id, const std::string &event_id) {
|
||||||
emit editChanged(edit_);
|
if (edit_.toStdString() == txn_id) {
|
||||||
}
|
edit_ = QString::fromStdString(event_id);
|
||||||
if (reply_.toStdString() == txn_id) {
|
emit editChanged(edit_);
|
||||||
reply_ = QString::fromStdString(event_id);
|
}
|
||||||
emit replyChanged(reply_);
|
if (reply_.toStdString() == txn_id) {
|
||||||
}
|
reply_ = QString::fromStdString(event_id);
|
||||||
});
|
emit replyChanged(reply_);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
connect(
|
connect(
|
||||||
manager_, &TimelineViewManager::initialSyncChanged, &events, &EventStore::enableKeyRequests);
|
manager_, &TimelineViewManager::initialSyncChanged, &events, &EventStore::enableKeyRequests);
|
||||||
@ -1064,7 +1066,7 @@ TimelineModel::viewRawMessage(const QString &id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TimelineModel::forwardMessage(const QString & eventId, QString roomId)
|
TimelineModel::forwardMessage(const QString &eventId, QString roomId)
|
||||||
{
|
{
|
||||||
auto e = events.get(eventId.toStdString(), "");
|
auto e = events.get(eventId.toStdString(), "");
|
||||||
if (!e)
|
if (!e)
|
||||||
@ -1426,8 +1428,9 @@ TimelineModel::addPendingMessage(mtx::events::collections::TimelineEvents event)
|
|||||||
void
|
void
|
||||||
TimelineModel::openMedia(const QString &eventId)
|
TimelineModel::openMedia(const QString &eventId)
|
||||||
{
|
{
|
||||||
cacheMedia(eventId,
|
cacheMedia(eventId, [](const QString &filename) {
|
||||||
[](const QString &filename) { QDesktopServices::openUrl(QUrl::fromLocalFile(filename)); });
|
QDesktopServices::openUrl(QUrl::fromLocalFile(filename));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -1505,7 +1508,8 @@ TimelineModel::saveMedia(const QString &eventId) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
TimelineModel::cacheMedia(const QString &eventId, const std::function<void(const QString)> &callback)
|
TimelineModel::cacheMedia(const QString &eventId,
|
||||||
|
const std::function<void(const QString)> &callback)
|
||||||
{
|
{
|
||||||
mtx::events::collections::TimelineEvents *event = events.get(eventId.toStdString(), "");
|
mtx::events::collections::TimelineEvents *event = events.get(eventId.toStdString(), "");
|
||||||
if (!event)
|
if (!event)
|
||||||
|
@ -189,7 +189,7 @@ class TimelineModel : public QAbstractListModel
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit TimelineModel(TimelineViewManager *manager,
|
explicit TimelineModel(TimelineViewManager *manager,
|
||||||
const QString& room_id,
|
const QString &room_id,
|
||||||
QObject *parent = nullptr);
|
QObject *parent = nullptr);
|
||||||
|
|
||||||
enum Roles
|
enum Roles
|
||||||
@ -272,7 +272,8 @@ public:
|
|||||||
Q_INVOKABLE bool saveMedia(const QString &eventId) const;
|
Q_INVOKABLE bool saveMedia(const QString &eventId) const;
|
||||||
Q_INVOKABLE void showEvent(QString eventId);
|
Q_INVOKABLE void showEvent(QString eventId);
|
||||||
Q_INVOKABLE void copyLinkToEvent(const QString &eventId) const;
|
Q_INVOKABLE void copyLinkToEvent(const QString &eventId) const;
|
||||||
void cacheMedia(const QString &eventId, const std::function<void(const QString filename)> &callback);
|
void
|
||||||
|
cacheMedia(const QString &eventId, const std::function<void(const QString filename)> &callback);
|
||||||
Q_INVOKABLE void sendReset()
|
Q_INVOKABLE void sendReset()
|
||||||
{
|
{
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
|
Loading…
Reference in New Issue
Block a user