diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-01-21 03:36:26 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2020-01-21 03:36:26 +0100 |
commit | dc44ac50a3768f26ad242af263c043e0e94febef (patch) | |
tree | df2161d39d3da51cb539975c5de6836b1f1c88bc /src/timeline | |
parent | Remove use of deprecated enum (diff) | |
download | nheko-dc44ac50a3768f26ad242af263c043e0e94febef.tar.xz |
Linkify links before sending
Diffstat (limited to 'src/timeline')
-rw-r--r-- | src/timeline/TimelineModel.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp index 2fd4b6d4..54e054ec 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp @@ -775,19 +775,18 @@ TimelineModel::replyAction(QString id) event = decryptEvent(*e).event; } - RelatedInfo related = {}; - related.quoted_user = QString::fromStdString(mtx::accessors::sender(event)); - related.related_event = mtx::accessors::event_id(event); - related.type = mtx::accessors::msg_type(event); - related.quoted_body = mtx::accessors::formattedBodyWithFallback(event); - related.quoted_body.remove(QRegularExpression( + RelatedInfo related = {}; + related.quoted_user = QString::fromStdString(mtx::accessors::sender(event)); + related.related_event = mtx::accessors::event_id(event); + related.type = mtx::accessors::msg_type(event); + related.quoted_body = QString::fromStdString(mtx::accessors::body(event)); + related.quoted_body = utils::getQuoteBody(related); + 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_; - // if (related.quoted_body.isEmpty()) - // return; - ChatPage::instance()->messageReply(related); } |