summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2019-06-14 20:45:37 -0400
committerJoseph Donofry <joedonofry@gmail.com>2019-06-14 20:45:37 -0400
commitcfd6c5703a7ca4a22fe1b1e78713b33f32f1a085 (patch)
treea56e17f0edf8e0aee455d93aafb40baa192d73c0 /src/timeline
parentFurther Improve Reply Functionality (diff)
downloadnheko-cfd6c5703a7ca4a22fe1b1e78713b33f32f1a085.tar.xz
Further UI Updates to Rich Replies
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineItem.cpp2
-rw-r--r--src/timeline/TimelineView.cpp10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/timeline/TimelineItem.cpp b/src/timeline/TimelineItem.cpp
index bf5b1b53..1094bde5 100644
--- a/src/timeline/TimelineItem.cpp
+++ b/src/timeline/TimelineItem.cpp
@@ -316,6 +316,8 @@ TimelineItem::TimelineItem(mtx::events::MessageType ty,
         }
 
         formatted_body = utils::linkifyMessage(formatted_body);
+        formatted_body.replace("mx-reply", "div");
+        nhlog::ui()->info("formatted_body: {}", formatted_body.toStdString());
 
         generateTimestamp(timestamp);
 
diff --git a/src/timeline/TimelineView.cpp b/src/timeline/TimelineView.cpp
index fc89fd38..18b73eb0 100644
--- a/src/timeline/TimelineView.cpp
+++ b/src/timeline/TimelineView.cpp
@@ -696,15 +696,21 @@ TimelineView::addUserMessage(mtx::events::MessageType ty,
 {
         auto with_sender = (lastSender_ != local_user_) || isDateDifference(lastMsgTimestamp_);
 
+        QString full_body;
+        if (related.related_event.empty()) {
+                full_body = body;
+        } else {
+                full_body = utils::getFormattedQuoteBody(related, body);
+        }
         TimelineItem *view_item =
-          new TimelineItem(ty, local_user_, body, with_sender, room_id_, scroll_widget_);
+          new TimelineItem(ty, local_user_, full_body, with_sender, room_id_, scroll_widget_);
 
         PendingMessage message;
         message.ty      = ty;
         message.txn_id  = http::client()->generate_txn_id();
         message.body    = body;
-        message.widget  = view_item;
         message.related = related;
+        message.widget  = view_item;
 
         try {
                 message.is_encrypted = cache::client()->isRoomEncrypted(room_id_.toStdString());