summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorMTRNord <mtrnord1@gmail.com>2021-12-27 20:49:27 +0100
committerMTRNord <mtrnord1@gmail.com>2021-12-27 20:49:27 +0100
commit7b2f7e65fd1bd0ceda02f3e0bb06b435ae37dfd6 (patch)
tree67d78c51375d65513c5a5c7a02f0d205bc827d27 /src/timeline/TimelineModel.cpp
parentApply (selective) Clang-tidy const function and new const pointer suggestions... (diff)
downloadnheko-7b2f7e65fd1bd0ceda02f3e0bb06b435ae37dfd6.tar.xz
Run linter
Diffstat (limited to '')
-rw-r--r--src/timeline/TimelineModel.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index 0447a56a..781f028e 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -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, // and update the event_id so that it points to the sent message and not the pending one. - connect( - &events, &EventStore::messageSent, this, [this](const std::string &txn_id, const std::string &event_id) { - if (edit_.toStdString() == txn_id) { - edit_ = QString::fromStdString(event_id); - emit editChanged(edit_); - } - if (reply_.toStdString() == txn_id) { - reply_ = QString::fromStdString(event_id); - emit replyChanged(reply_); - } - }); + connect(&events, + &EventStore::messageSent, + this, + [this](const std::string &txn_id, const std::string &event_id) { + if (edit_.toStdString() == txn_id) { + edit_ = QString::fromStdString(event_id); + emit editChanged(edit_); + } + if (reply_.toStdString() == txn_id) { + reply_ = QString::fromStdString(event_id); + emit replyChanged(reply_); + } + }); connect( manager_, &TimelineViewManager::initialSyncChanged, &events, &EventStore::enableKeyRequests); @@ -1064,7 +1066,7 @@ TimelineModel::viewRawMessage(const QString &id) } void -TimelineModel::forwardMessage(const QString & eventId, QString roomId) +TimelineModel::forwardMessage(const QString &eventId, QString roomId) { auto e = events.get(eventId.toStdString(), ""); if (!e) @@ -1426,8 +1428,9 @@ TimelineModel::addPendingMessage(mtx::events::collections::TimelineEvents event) void TimelineModel::openMedia(const QString &eventId) { - cacheMedia(eventId, - [](const QString &filename) { QDesktopServices::openUrl(QUrl::fromLocalFile(filename)); }); + cacheMedia(eventId, [](const QString &filename) { + QDesktopServices::openUrl(QUrl::fromLocalFile(filename)); + }); } bool @@ -1505,7 +1508,8 @@ TimelineModel::saveMedia(const QString &eventId) const } 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(), ""); if (!event)