about summary refs log tree commit diff
path: root/app/lib/formatter.rb
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-08-23 09:38:27 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:20 -0500
commit5622de4a785e6b7c9a4946af3efaf8b4c2bc5755 (patch)
treeb9378500aa449af54ac09c44b2aba8f6ee2a184b /app/lib/formatter.rb
parent5de7e2d667fa55f353a8b3d988cd047c118a4250 (diff)
[Feature] Support Misskey-compatible boosts with attached content notes
Diffstat (limited to 'app/lib/formatter.rb')
-rw-r--r--app/lib/formatter.rb18
1 files changed, 8 insertions, 10 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 5559ddb73..6673f4b4b 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -32,15 +32,8 @@ class Formatter
   include ActionView::Helpers::TextHelper
 
   def format(status, **options)
-    if status.reblog?
-      prepend_reblog = status.reblog.account.acct
-      status         = status.proper
-    else
-      prepend_reblog = false
-    end
-
     summary = nil
-    raw_content = status.text
+    raw_content = status.proper.text
     summary_mode = false
 
     if status.title.present?
@@ -56,8 +49,13 @@ class Formatter
     return '' if raw_content.blank?
     return format_remote_content(raw_content, status.emojis, summary: summary, **options) unless status.local?
 
-    html = raw_content
-    html = "RT @#{prepend_reblog} #{html}" if prepend_reblog
+    if status.reblog?
+      html = "🔁 @#{status.reblog.account.acct}\n🔗 #{ActivityPub::TagManager.instance.url_for(status.reblog)}"
+      html += "\nℹ️ #{status.reblog.spoiler_text}" if status.reblog.spoiler_text.present?
+    else
+      html = raw_content
+    end
+
     html = "📄 #{html}" if summary_mode
     return html if options[:plaintext]