summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-04-13 16:22:30 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-04-13 16:22:30 +0200
commitdcddea6fb89246d63be91a1f1151ce2dbd255a12 (patch)
tree5d3782b9d7763ab83b0d65d183e37dc29fcd40e6 /src/timeline/TimelineModel.cpp
parentFix notification not being cleared, when read event didn't cause a notification (diff)
downloadnheko-dcddea6fb89246d63be91a1f1151ce2dbd255a12.tar.xz
Fix reply not closing
fixes #124
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r--src/timeline/TimelineModel.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index 84dd9885..d54677f7 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -800,6 +800,16 @@ TimelineModel::decryptEvent(const mtx::events::EncryptedEvent<mtx::events::msg:: void TimelineModel::replyAction(QString id) { + setReply(id); + ChatPage::instance()->focusMessageInput(); +} + +RelatedInfo +TimelineModel::relatedInfo(QString id) +{ + if (!events.contains(id)) + return {}; + auto event = events.value(id); if (auto e = std::get_if<mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>(&event)) { @@ -815,10 +825,9 @@ TimelineModel::replyAction(QString id) related.quoted_formatted_body = mtx::accessors::formattedBodyWithFallback(event); related.quoted_formatted_body.remove(QRegularExpression( "<mx-reply>.*</mx-reply>", QRegularExpression::DotMatchesEverythingOption)); - nhlog::ui()->debug("after replacement: {}", related.quoted_body.toStdString()); related.room = room_id_; - ChatPage::instance()->messageReply(related); + return related; } void