From c34c9f90352549919f9f7c1d247681efea0b6637 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 30 Sep 2022 03:43:42 +0200 Subject: Automatically switch to threading when replying --- src/timeline/TimelineModel.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/timeline/TimelineModel.cpp') diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 01856a4d..3680c5f9 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -2684,6 +2684,19 @@ TimelineModel::resetThread() emit threadChanged(thread_); } } +void +TimelineModel::setReply(const QString &newReply) +{ + if (reply_ != newReply) { + reply_ = newReply; + + if (auto ev = events.get(reply_.toStdString(), "", false, true)) + setThread(QString::fromStdString( + mtx::accessors::relations(*ev).thread().value_or(thread_.toStdString()))); + + emit replyChanged(reply_); + } +} void TimelineModel::setEdit(const QString &newEdit) -- cgit 1.5.1