summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r--src/timeline/TimelineModel.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index b2a036c5..ce136e35 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -521,6 +521,8 @@ TimelineModel::TimelineModel(TimelineViewManager *manager, QString room_id, QObj cache::client()->updateState(room_id_.toStdString(), events_, true); this->syncState({std::move(events_.events)}); }); + + connect(this, &TimelineModel::ignoredUser, this, &TimelineModel::handleIgnoredUser); } QHash<int, QByteArray> @@ -2109,6 +2111,17 @@ TimelineModel::scrollTimerEvent() } void +TimelineModel::handleIgnoredUser(const QString &id, const std::optional<QString> &err) +{ + if (err) { + MainWindow::instance()->showNotification( + tr("Failed to ignore \"%1\": %2").arg(id).arg(*err)); + } else { + this->clearTimeline(); + } +} + +void TimelineModel::requestKeyForEvent(const QString &id) { auto encrypted_event = events.get(id.toStdString(), "", false);