Skip to content
Snippets Groups Projects
Verified Commit c34c9f90 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Automatically switch to threading when replying

parent 88cbac16
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -363,16 +363,7 @@ public slots:
std::vector<QString> typingUsers() const { return typingUsers_; }
bool paginationInProgress() const { return m_paginationInProgress; }
QString reply() const { return reply_; }
void setReply(const QString &newReply)
{
if (edit_.startsWith('m'))
return;
if (reply_ != newReply) {
reply_ = newReply;
emit replyChanged(reply_);
}
}
void setReply(const QString &newReply);
void resetReply()
{
if (!reply_.isEmpty()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment