summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-09-30 03:43:42 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-09-30 03:43:42 +0200
commitc34c9f90352549919f9f7c1d247681efea0b6637 (patch)
treef58e81433d3ce9cfdb23ce73baf06f52cd2a6400 /src/timeline/TimelineModel.cpp
parentBasic threading support (diff)
downloadnheko-c34c9f90352549919f9f7c1d247681efea0b6637.tar.xz
Automatically switch to threading when replying
Diffstat (limited to '')
-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 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)